
n = int(input())


arr = list(map(int,input().split(' ')))

arr = sorted(arr)

temp1 = 0
temp2 = 0
i = 0
for i in range(0,int(n/2)):
    temp1 = temp1 + abs(int(arr[i])-(2*i+1))
    temp2 = temp2 + abs(int(arr[i])-(2*i+2))

print(min(temp1,temp2))


