n = int(input())
cl = sorted(list(map(int, input().split())))
count1 = 0
count2 = 0
pos1 = 1
pos2 = 2
for x in cl:
    count1+=abs(x-pos1)
    pos1+=2
    count2+=abs(x-pos2)
    pos2+=2
print(min(count1, count2))