n = int(input())
a = list(map(int, input().split()))
rec1, rec2 = 0, 0
a = sorted(a)
dic1, dic2 = [], []

for i in range(n):
    if i % 2 == 0:
        k = float("inf")
        for j in range(n // 2):
            if k > abs(a[j] - 1 - i) and j not in dic1:
                index = j
                k = abs(a[j] - 1 - i)
        rec1 += k
        dic1.append(index)


for i in range(n):
    if i % 2 != 0:
        k = float("inf")
        for j in range(n // 2):
            print(a[j])
            if k > abs(a[j] - 1 - i) and j not in dic2:
                index = j
                k = abs(a[j] - 1 - i)
        rec2 += k
        dic2.append(index)

print(min(rec1, rec2))