'''input
10
1 2 3 4 5
'''

#~ @author = dwij28 (Abhinav Jha) ~#

n, data = input(), sorted(map(int, raw_input().strip().split()))
a, b, x, y = 0, 0, 1, 2
for i in data: a, x = a+abs(i-x), x+2
for i in data: b, y = b+abs(i-y), y+2
print min(a, b)