def mod(a):
	if a>=0:
		return a
	return -a
n = int(input())
a = [int(x) for x in input().split()]
a = sorted(a)
cb,cw = 0,0
for i in range(len(a)):
	cb += mod((2*i)+1-a[i])
	cw += mod((2*i)+2-a[i])
print(min(cb,cw))