#!python
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    p = [int(c) for c in input().split()]
    p.sort()
    B = [i for i in range(1, n + 1, 2)]
    W = [i for i in range(2, n + 1, 2)]

    white = 0
    black = 0

    for i in range(n // 2):
        white += abs(B[i] - p[i])
        black += abs(W[i] - p[i])
    print(min(white, black))


if __name__ == '__main__':
    main()
