N = int(input()) L = sorted(map(int, input().split())) c = 0 for i in range(N): c += abs(L[i] - (i+1)) print(c)