#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int inf = 1 << 30;
int n, t;
int main() {
  cin >> n;
  int v;
  set<int> s;
  for (int i = 0; i < n; i++) {
    cin >> v;
    if (v != 0) s.insert(v);
  }
  int a = s.size();
  if (a != 0)
    cout << a << endl;
  else
    cout << 1 << endl;
  return 0;
}
