def main():
    n = int(input())
    p = list(map(int, input().split()))
    p.sort()
    s1 = sum(abs(i * 2 + 2 - p[i]) for i in range(n // 2))
    s2 = sum(abs(i * 2 + 1 - p[i]) for i in range(n // 2))
    print(min(s1, s2))


if __name__ == '__main__':
    main()

# Sun Jan 03 2021 15:02:17 GMT+0300 (Москва, стандартное время)
