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

b = sum([abs((p[i] - 1) - i * 2) for i in range(0, n // 2)])
w = sum([abs((p[i] - 1) - (i * 2 + 1)) for i in range(0, n // 2)])
print(min(b, w))
