from bisect import bisect_left, bisect_right

def tuple_input(type):
    return map(type, input().strip().split())

n = int(input())
p = list(tuple_input(int))
p.sort()
p = list(map(lambda x : x - 1, p))

t = [2 * i for i in range(n // 2)]
black = 0
for i in range(n // 2):
    black += abs(p[i] - t[i])
t = list(map(lambda x : x + 1, t))
white = 0
for i in range(n // 2):
    white += abs(p[i] - t[i])
print(min(black, white))

    