#include <bits/stdc++.h>
#pragma GCC optimize("O3")
const int N = 10e5 + 5;
const int OO = 1e9;
const long long MOD = 1000000007;
using namespace std;
int main() {
  long long n, g = 0, d = 0, cur = 0;
  cin >> n;
  set<long long> st;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a) st.insert(a);
  }
  cout << st.size();
  return 0;
}
