#include <bits/stdc++.h>
int main() {
  int size, i, j, k;
  scanf("%d", &size);
  int arr[size];
  for (i = 0; i < size; i++) scanf("%d", &arr[i]);
  for (i = 0; i < size; i++) {
    for (j = i + 1; j < size;) {
      if (arr[j] == arr[i] || arr[j] == 0) {
        for (k = j; k < size; k++) {
          arr[k] = arr[k + 1];
        }
        size--;
      } else
        j++;
    }
  }
  if (arr[0] == 0)
    printf("%d\n", size - 1);
  else
    printf("%d\n", size);
  return (0);
}
