n = int(input())
piece = list(map(int, input().split()))
piece.sort()
a = []
b = []
temp = 0
for i in range(n//2):
    temp+=2
    a.append(0+temp)
    b.append(-1+temp)
min1 = 0
for j, k in zip(a,piece):
    min1+=abs(j-k)
min2 = 0
for j ,k in zip(piece,b):
    min2+=abs(j-k)
if min1<min2:
    print(min1)
else:
    print(min2)