#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  int i;
  for (i = 0; i < n; i++) {
    int a;
    cin >> a;
    arr[i] = a;
  }
  sort(arr, arr + n);
  int count = 0;
  for (i = 1; i < n; i++) {
    if (arr[i] == 0)
      continue;
    else if (arr[i] != 0 && arr[i] != arr[i - 1])
      count++;
  }
  if (arr[0] != 0) count++;
  cout << count << "\n";
}
