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