def get_ints():
    return list(map(int, input().split()))

N = int(input())
a = get_ints()
a = sorted(a)
g = sum([abs(a[i]-(2*i+1)) for i in range(N//2)])
h = sum([abs(a[i]-(2*i+2)) for i in range(N//2)])
print(min(g,h))