n = int(input())
a = list(map(int, input().split()))
a.sort()
resodd = 0
reseven = 0
n = int(n/2)
for i in range(n):
	resodd += abs(i * 2 + 1 - a[i])
	reseven += abs(i * 2 + 2 - a[i])
print(min(resodd, reseven))