# -*- coding:utf-8 -*-
#[n, m] = [int(x) for x in raw_input().split()]

def some_func():
    """
    """
    n = input()
    n_list = [ int(x) for x in raw_input().split()]
    s1 = 0
    s2 = 0
    n_list.sort()
    for i in range(n/2):
        s1 += abs(1+2*i -n_list[i])
        s2 += abs(2+2*i - n_list[i])
    return min([ s1,s2])



if __name__ == '__main__':
    print some_func()



