N = int(input()) A = set(list(map(int, input().split()))) print(sum(i for i in range(3, 36) if i in A and i-1 not in A))