import java.io.*;
import java.util.*;
import java.lang.*;
public class Main34{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n/2 +1];
        for(int i=0;i<n/2;i++){
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        int ans1 = 0;
        int ans2 = 0;
        for(int i=0;i<n/2;i++){
            ans1 = ans1 + Math.abs(arr[i]- i*2 + 1);
            ans2 = ans2 + Math.abs(i*2 + 2);
        }
        System.out.println(Math.min(ans1,ans2));
    }
}