n = int(input()) A = list(map(int, input().split())) A.sort() print(sum([abs(i + 1 - e) for i, e in enumerate(A)]))