n = int(raw_input())
l = map(int, raw_input().split())
l = sorted(l)
a = 0
b = 0
im = 1
for i in range(len(l)):
  if(l[i]!=im):
    a += abs(l[i]-im)
  im += 2
pa = 2
for i in range(len(l)):
  if(l[i]!=pa):
    b += abs(l[i]-pa)
  pa += 2
print(min(a,b))