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