{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e Consider a country X consists of a large number of islands. Two islands are connected if there is a bridge between them. Mr. Noyon wants to visit all the island of country X. \u003c/p\u003e\n\n\u003cp\u003e In one single day Mr. Noyon can visit all the connected islands i.e. all the islands that can be visited from one to another through bridges.\u003c/p\u003e \n\u003cp\u003eHe cannot visit those islands in a single day which are not connected. He has to wait for the next day to come to go to another island of country X by boat that is not connected to the set of islands he is currently in. And then on the next day he can visit all the islands that can be gone through bridges.\u003c/p\u003e\nWrite a program to determine the number of days Mr. Noyon needs to visit all the islands of country X. \u003c/p\u003e\n\n\n\u003cimg src\u003d\"https://i.imgur.com/lHLxkqe.png\" /\u003e\n\u003cbr\u003e \n\n\u003cp\u003e For example : A-\u003eB,B-\u003eD,C-\u003eE (A-\u003eB means island A connected with island B with a bridge and vice versa) in this situation Mr. Noyon needs two days to visit all the island of country X. 1st day he visits island A,B,D and 2nd day he visits island C,E. \u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe input begins with a single positive integer on a line by itself indicating the number of the casesfollowing, each of them as described below. This line is followed by a blank line, and there is also a blank line between two consecutive inputs.\u003c/p\u003e\n\u003cp\u003eThe first line of each input set contains a single uppercase alphabetic character. This character represents the largest island name in the country. Each successive line contains a pair of uppercase alphabetic characters denoting a bridge.\u003c/p\u003e\n\u003cp\u003eInput is terminated by a blank line.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, write in the output the number of days to visit all the island of country X. The outputs of two consecutive cases will be separated by a blank line.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cp\u003e1\u003c/p\u003e\n\u003cbr\u003e\n\u003cp\u003eE\u003c/p\u003e\n\u003cp\u003eAB\u003c/p\u003e\n\u003cp\u003eBC\u003c/p\u003e\n\u003cp\u003eDE\u003c/p\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cp\u003e2\u003c/p\u003e"}}]}