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