#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
long long A[N], n, m, ans;
char s[N];
int main() {
  set<int> S;
  cin >> n;
  for (int i = 1, x; i <= n; ++i) {
    cin >> x;
    if (x == 0) continue;
    S.insert(x);
  }
  cout << S.size();
  return 0;
}
