N = input() A = map(int, raw_input().split()) print abs(N * (N+1) / 2 - sum(A))