import sys from collections import defaultdict N = int(input()) a_li = list(map(int,input().split())) a_li.sort() ans = 0 for i in range(N): ans += abs(i+1 - a_li[i]) print(ans)