Const Fi='LUCKY.INP';
Fo='LUCKY.OUT';
Type manga = array[1..1000] of longint;
Var f,g: text;
A,B: manga;
n,i,j,max,so: longint;
Function tongcs(a: longint): longint;
Var s: longint;
Begin
s:=0;
While a<>0 do
Begin
s:=s+a mod 10;
a:=a div 10;
End;
tongcs:=s;
End;
Function SCC(a: longint): byte;
Begin
While a>9 do
a:=tongcs(a);
SCC:=a;
End;
Function dem(a: manga; n,x: longint): longint;
Var i,c: longint;
Begin
c:=0;
For i:=1 to n do
If A[i]=x then inc(c);
dem:=c;
End;
Begin
Assign(f,Fi); Reset(f);
Assign(g,Fo); Rewrite(g);
Readln(f,n);
For i:=1 to n do Readln(f,A[i]);
For i:=1 to n do
A[i]:=SCC(A[i]);
B[i]:=0;
For i:=1 to n do
For j:=i to n do
If A[i]=A[j]then inc(B[i]);
max:=B[1];
For i:=1 to n do
If B[i]>max then max:=B[i];
Write(g,max);
Close(f);
Close(g);
End.