n = int(input()) print(sum([abs(i - j) for i, j in zip(range(1, n+1), sorted(list(map(int, input().split()))))]))