#!/usr/bin/python

from collections import deque

def ir(): return int(raw_input())
def ia(): return map(int, raw_input().split())

n = ir()
a = ia(); a = [e - 1 for e in a]; a.sort()

def move(rem):
    ok = set()
    ans = 0
    for i in a:
        for j in xrange(n):
            if j % 2 == rem: continue
            if not j in ok:
                ok.add(j)
                ans += abs(i - j)
                break
    return ans


print min(move(0), move(1))
