n=int(input()) l=list(map(int,input().split())) #ans_l=list(map(lambda x:x-1 l)) ans=0 for i in range(n): if l[i]-1 not in l:ans+=l[i] print(ans)