n = int(input())

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

pos = sorted(pos)

countStepB = 0
for i in range(len(pos)):
    cur = pos[i]
    if cur % (1+i*2) != 0:
        countStepB += abs((1+i*2) - cur)

countStepW = 0
for i in range(len(pos)):
    cur = pos[i]

    if cur % (2+i*2) != 0:
        countStepW += abs((2+i*2) - cur)


print(min(countStepB, countStepW))
