#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a[1000999], i, diff, count = 1, z = 0;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (i = 0; i < (n - 1); i++) {
    if (a[i] != a[i + 1]) count++;
  }
  for (i = 0; i < n; i++) {
    if (a[i] == 0) z++;
  }
  if (z > 0)
    cout << count - 1 << endl;
  else
    cout << count << endl;
  return 0;
}
