inline T read(){ T sum = 0, fl = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) if (ch == '-') fl = -1; for (; isdigit(ch); ch = getchar()) sum = sum * 10 + ch - '0'; return sum * fl; }
template <typename T>
inlinevoidwrite(T x){ static T sta[35]; int top = 0; do { sta[top++] = x % 10, x /= 10; } while (x); while (top) putchar(sta[--top] + 48); }
ll power(ll x, ll y){ if (y == 1) return x % p; ll ret = power(x, y >> 1) % p; ret = ret * ret, ret %= p; if (y % 2) ret *= x, ret %= p; return ret % p; }
intmain(){ cin >> p; while (cin >> t) st.insert(t);
cout << st.size() << '\n';
ans = power(2, st.size()) + p; // 公式 cout << ans % p << '\n';