CSES - Shared codeLink to this code: https://cses.fi/paste/6b9842c9b46ce28d778f8d/
import sys
input = sys.stdin.readline
output = sys.stdout.write # must be string


n = int(input())
arr = sorted(int(x) for x in input().split())

s = {1}
ok = 0
for i in range(0,n):
    if arr[i] == 1:
        ok = 1
    s.add(arr[i])

ans = len(s)
if (ok == 0):
    ans = ans - 1

output(f"{ans}")