# -*- coding: utf-8 -*-
"""
Created on Fri Jun  1 19:35:17 2018

@author: Paras Sharma
"""

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