N = int(input()) As = list(map(int, input().split())) print(abs(sum(As)-sum([i for i in range(1,N+1)])))