N = int(input())
r1 = 0
r2 = 0

arr = sorted(list(map(int, input().split())))

for i,j in enumerate(range(1, N+1, 2)):
    r1 += abs(arr[i] - (j))
for i,j in enumerate(range(2, N+1, 2)):
    r2 += abs(arr[i] - (j))
print(min(r1, r2))
