#include <iostream>
#include <string>

using namespace std;

int main()
{
    int op,nr,k=0;
    cin>>op;
    int list[op];
    
    cin>>nr;
    nr=nr%23;
    list[0]=nr;
    
    while(op>1)
    {
        cin>>nr;
        nr=nr%23;
       bool ok=false;
       for (int i=0; i<=k;i++)
       {
           if (nr==list[i])
            ok=true;
       }
       if (ok==false)
        {
            k++;
            list[k]=nr;
        }
        op--;
    }
    cout<<k+1;
}