def chess(lst, m):
    count1, count2 = 0, 0
    for i in range(m // 2):
        count1 += abs(lst[i] - 1 - 2 * i)
        count2 += abs(lst[i] - 2 - 2 * i)
    return min(count1, count2)


n = int(input())
a = [int(j) for j in input().split()]
print(chess(sorted(a), n))
