#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int oo = 1e9 + 10;
const int mod = 1e9 + 7;
int n;
set<int> st;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int x;
    cin >> x;
    if (x != 0) st.insert(x);
  }
  cout << st.size();
}
