#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<long int> numbers;
  long int n, temp, count;
  scanf("%ld", &n);
  numbers.clear();
  for (long int i = 0; i < n; i++) {
    scanf("%ld", &temp);
    numbers.push_back(temp);
  }
  sort(numbers.begin(), numbers.end());
  temp = -100001;
  count = 0;
  for (long int i = 0; i < n; i++) {
    if (numbers[i] > temp) {
      temp = numbers[i];
      if (numbers[i] != 0) count++;
    }
  }
  printf("%ld", count);
  return 0;
}
