n = int(input())
piece = list(map(int,input().split()))
ans1 = 0
ans2 = 0
piece = sorted(piece)
for i in range(len(piece)):
    ans1 += abs((piece[i]-1)-(i*2))
    ans2 += abs((piece[i]-1)-(i*2+1))
print(min(ans1,ans2))