N = int(input()) A = list(map(int, input().split())) print(sum(a for a in A if a-1 not in A))