def adjustposeven(lst, i, moves):
    if(lst[i] % 2 == 1):
        lst[i]+=1
        moves +=1
    else:
        lst[i] += 2
        moves +=2
    if(lst[i + 1] == lst[i]):
        moves += adjustposeven(lst, i+1, moves)
    elif(lst[i-1] == lst[i]):
        moves += adjustposeven(lst, i, moves)
    return moves


def adjustposodd(lst, i, moves):
    if(lst[i] % 2 == 0):
        lst[i]+=1
        moves +=1
    else:
        lst[i] += 2
        moves +=2
    if(lst[i + 1] == lst[i]):
        moves += adjustposodd(lst, i+1, moves)
    elif(lst[i-1] == lst[i]):
        moves += adjustposodd(lst, i, moves)
    return moves


n = input()
lst = map(int, raw_input().split(' '))
lst.sort()

moveseven = 0;
movesodd = 0;


for i in range(len(lst)):
    if (lst[i] != (2*i) + 1):
        movesodd += abs(lst[i] - ((2*i) + 1))

for i in range(1, len(lst) + 1):
    if(lst[i-1] != 2*i):
        moveseven += abs(lst[i-1] - 2*i)

if(movesodd < moveseven):
    print movesodd
else:
    print moveseven
