# -*- coding: utf-8 -*- N = int(input()) A = list(map(int, input().split())) dp = [False] * 1000000 solution(0, 0) pattern = 0 for b in dp: if b: pattern += 1 print(pattern) def solution(i, m): if not dp[m]: if i