def main():
    n = int(input())
    p = [int(c) for c in input().split()]
    p.sort()
    
    moves_odd = 0
    moves_even = 0
    for i in range(n // 2):
        moves_odd += abs(p[i] - (i * 2 + 1))
        moves_even += abs(p[i] - i * 2 - 2)

    print(min(moves_odd, moves_even))


if __name__ == '__main__':
    main()
