var a:array[0..100]of integer; v:array[1..100]of integer;
i,n,j,s:integer;
begin
   read(n);

      for i:=1 to n do
      readln(v[i]);


      for i:=0 to 22 do
      a[i]:=0;

      s:=0;

      for i:=1 to n do
      begin
          for j:=0 to 22 do
          If v[i] mod 23=j then inc(a[j]);
          end;

      for j:=0 to 22 do
      If a[j]<>0 then s:=s+1;


    writeln(s);
    readln;
    end.