#!/usr/bin/env python3
from sys import stdin


def solve(tc):
    n = int(stdin.readline().strip())
    li = list(map(int,stdin.readline().split()))
    li.sort()

    odd = 0
    p = 1
    for i in range(n//2):
        odd += abs(li[i]-p)
        p += 2
    
    even = 0
    p = 2
    for i in range(n//2):
        even += abs(li[i]-p)
        p += 2
    
    print(min(odd,even))


tc = 1
solve(tc)