import java.util.*;

public class EducationalRound44A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        for(int i = 0; i < n/2; i++) {
            list.add(sc.nextInt());
        }
        Collections.sort(list);
        int odd = 1;
        int even = 2;
        int sumOdd = 0;
        int sumEven = 0;
        for(int a : list){
            sumOdd+=Math.abs(a-odd);
            sumEven+=Math.abs(a-even);
            odd+=2;
            even+=2;
        }

        System.out.println(Math.min(sumOdd, sumEven));
    }
}
