a = int(input()) b = sorted(map(int,input().split())) ans = 0 for i in range(a): ans += abs(b[i] - (i+1)) print(ans)