#include <bits/stdc++.h>
using namespace std;
int a[100001] = {};
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (((i == 1) || a[i] != a[i - 1]) && a[i] != 0) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
