
n = int(input())

numbers = list(map(int,input().split()))
numbers.sort()

allWhite = 0
allBlack = 0

for i in range (len(numbers)):
    allWhite += abs(numbers[i] - 2*i -1)
    allBlack += abs(numbers[i] - 2*i -2)

print(min(allWhite,allBlack))