n = int(input()) l = list(map(int, input().split())) l.sort() k = [i for i in range(1,n+1)] result = 0 for i in range(n): result += abs(l[i] - k[i]) print(result)