#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin.exceptions(cin.failbit);
  int n;
  cin >> n;
  set<int> u;
  for (int i = 0; i < (n); ++i) {
    int in;
    cin >> in;
    if (in != 0) u.insert(in);
  }
  cout << (int)(u).size() << endl;
  return 0;
}
