if __name__ == '__main__':
    ans1, ans2 = 0,0
    n = int(input())
    vals = input().split(' ')
    vals = [int(x) for x in vals]
    vals.sort()
    i = 1
    for k in vals:
        ans1 += abs(i - k)
        ans2 += abs(i + 1 - k)
        i += 2
    print(min(ans1,ans2))
