n=int(input())
arr=list(map(int,input().split()))
arr.sort()
even=0
for i in range(len(arr)):
    even+=abs((i+1)*2-arr[i])
odd=0
for i in range(len(arr)):
    odd+=abs((i+1)*2-1-arr[i])
print(min(even,odd))