def process():
    totalsize=int(raw_input())
    list1=[int(i) for i in raw_input().split()]
    if totalsize>2:
        list2=[i for i in range(1,totalsize+1,2)]
        list3=[i for i in range(2,totalsize+1,2)]
        list1.sort()
        ans2=sum([abs(list3[i]-list1[i]) for i in range(len(list1))])
        ans1=sum([abs(list2[i]-list1[i]) for i in range(len(list1))])
        ans=ans2 if ans2<ans1 else ans1
        print(ans)
    else:
        print("0")

process()