def f(n, p, p2):
    ans = 0
    for i, j in zip(p, p2):
        ans += abs(i - j)
    return ans

n = int(input())
p = sorted(list(map(int, input().split(' '))))
# print(n, p)

odd = [2*i+1 for i in range(n // 2)]
even = [i+1 for i in odd]
# print(odd, even)
print(min(f(n, p, odd), f(n, p, even)))
