{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cp\u003e天真的Wells认为自己的骰子是独一无二的。\u003c/p\u003e \n \u003cp\u003e当有人告诉他的骰子很可能在商店里有很多个时,Wells简直不敢相信自己的小耳朵!\u003c/p\u003e \n \u003cdiv class\u003d\"figure\"\u003e \n \u003cimg SRC\u003d\"CDN_BASE_URL/a1902f7cd29460f51564f5630a2b79cd?v\u003d1591823064\"\u003e \n \u003c/div\u003e \n \u003cp\u003e那么问题来了,眼花的Wells会告诉你他的独特的骰子的6个面,然后再告诉你一堆商店里骰子。\u003c/p\u003e \n \u003cp\u003e问和Wells的独特骰子长得一模一样的到底有多少个。\u003c/p\u003e \n \u003cp\u003e当然骰子是可以任意旋转的。\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cp\u003e第一行一个数n。接下来n行每行6个数,分别表示这个骰子的前后左右上下面上的数字。其中第一行为Wells的独特骰子,剩余的为商店骰子。 $ (N\u0026lt;\u003d10000) $\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\n \u003cp\u003e输出有几个骰子(不包括第一个)是和第一个一样的。\u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e6\n1 2 3 4 5 6\n3 4 2 1 5 6\n4 3 1 2 5 6\n5 6 3 4 2 1\n1 2 3 4 6 5\n6 6 6 6 6 6\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e3\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003chtml\u003e\n \u003chead\u003e\u003c/head\u003e\n \u003cbody\u003e\u003c/body\u003e\n\u003c/html\u003e"}}]}