数对子


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

小明很喜欢找对子,也很喜欢玩编程,用编程来验证自己找对子的正确性,很有成就感。

Input

多组数据。每组数据第一行为整数M(0<M<10)。表示后面跟M个数字行,每个数字行是四个没有空格间隔的一位数字。若M为0,则输入结束。

Output

统计每一组数据中,各数字行的对子数总和,以一行输出。显然若仅有三个数字相同,则只能算一个对子。

Sample

Input

5
1234
1111
2342
5556
7890
2
1122
2343
0

Output

4
3

Source: qn


Comments

There are no comments at the moment.