def main():
    n = int(input())
    numbers = sorted([x - 1 for x in list(map(int, input().split()))])

    evens = [abs(item[0] - item[1]) for item in zip([x for x in range(0, n + 1, 2)], numbers)]
    odds = [abs(item[0] - item[1]) for item in zip([x for x in range(1, n, 2)], numbers)]

    print(min(sum(evens), sum(odds)))


if __name__ == "__main__":
    main()
