n = int(input())
array = []
line = input()
for x in line.split():
    array.append(int(x))
s1 = s2 = 0
a1 = 1
a2 = 2
array.sort()
for i in array:
    s1 += abs(i - a1)
    s2 += abs(i - a2)
    a1 += 2
    a2 += 2
print(min(s1, s2))




