시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 73 51 49 76.562%

문제

현수는 열기구 여름특강의 강사다. 현수는 매우 성실해서 모든 수강생들의 열기구 비행을 기록하고있다. 매 비행 이후, 현수는 그 비행에 참석한 수강생들의 기록을 리스트에 추가한다. 리스트에는 각 수강생마다 띄웠던 기구의 인식번호만이 기록된다. 

매 시즌이 끝난 후, 현수는 얼마나 많은 종류의 열기구들을 비행해봤는지에 따른 수강생들의 숙련도를 분류해 나열하려고한다. 만약 두 수강생이 비행했던 열기구의 종류들이 같다면 두 수강생은 같은 숙련도를 가진것으로 분류된다. (이 경우, 비행을 한 횟수는 관계가 없다.)

현수는 총 9 종류의 열기구를 관리하며, 수강생들의 기록은 각 열기구의 번호들로써 이루어진다. 모든 수강생들 중 비행 횟수가 9번을 넘는 수강생은 없다. (1번 열기구를 세번 2번과 3번을 각각 한번씩 운용했던 수강생의 번호는 11123이 되겠다.) 

예를 들어, 수강생 234423과 수강생 342는 같은 숙련도를 가진 것으로 분류된다. 하지만 수강생 118821과 수강생 1189821 같은 경우는 9번 열기구 비행 유무의 차이로 다른 숙련도를 가진 것으로 분류된다.

현수의 리스트에 있는 수강생들이 총 몇개의 숙련도로 분류되는지 구하라.

입력

각 테스트케이스마다 첫 줄에는 총 수강생의 수인 정수 N(1 ≤ N ≤ 1 000) 이 주어진다.

이어지는 N줄은 열기구 비행 기록을 나타내는 각 수강생들의 번호들이 주어진다.

출력

매 테스트케이스마다 각 줄에 현수의 리스트에 있는 수강생들의 숙련도가 몇 개로 분류되어지는지 출력하라.

예제 입력 1

5
132
42
3312
43
24424
3
222
22
2

예제 출력 1

3
1
W3sicHJvYmxlbV9pZCI6IjEzOTE1IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVkNjA0XHVjMjE4XHVjNzU4IFx1YzVmNFx1YWUzMFx1YWQ2YyBcdWFkNTBcdWMyZTQiLCJkZXNjcmlwdGlvbiI6IjxwPlx1ZDYwN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