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