n = int(raw_input())
arr = map(int, raw_input().split())
arr = sorted(arr)
count = 0
count1 = 0
for i in range(n/2):
	count += abs(arr[i] - (2*i+1))
	count1 += abs(arr[i] - (2*i+2))
print min(count, count1)