n = input()
str_arr = raw_input().split()
a = [int(num) for num in str_arr]
sum1 = 0
sum2 =0
j = 1
for i in a:
    sum1 = sum1+abs(i-j)
    j+=2
j = 2
for i in a:
    sum2 = sum2 +abs(i-j)
    j+= 2
print min(sum1,sum2)
