#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, x, sec = 0;
  vector<int> nums;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    nums.push_back(x);
  }
  sort(nums.begin(), nums.end());
  x = 0;
  for (i = 0; i < n; i++) {
    if (nums[i] != 0 && nums[i] != nums[i - 1]) {
      sec++;
    }
  }
  printf("%d\n", sec);
  return 0;
}
