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