import sys
import math
import bisect

def main():
    n = int(input())
    A = list(map(int, input().split()))
    A.sort()
    min_val = 10 ** 18
    val = 0
    for i in range(n // 2):
        val += abs(A[i] - (2*i+2))
    min_val = min(min_val, val)
    val = 0
    for i in range(n // 2):
        val += abs(A[i] - (2*i+1))
    min_val = min(min_val, val)
    print(min_val)

if __name__ == "__main__":
    main()
