n=input()
a=[0]*(n/2)
arr=map(int,raw_input().split())
for i in xrange(n/2):
  a[i]=arr[i]
a=sorted(a)
ans=0;cnt=0;curr=n
for i in xrange(n/2-1,-1,-1):
  cnt+=abs(curr-a[i])
  curr-=2
ans=cnt
cnt=0;curr=n-1
for i in xrange(n/2-1,-1,-1):
  cnt+=abs(curr-a[i])
  curr-=2
print min(cnt,ans)
