import java.util.*;
import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        StringTokenizer stk = new StringTokenizer(br.readLine());
        int[] arr = new int[n/2];
        for(int i=0;i<n/2;i++){
            arr[i] = Integer.parseInt(stk.nextToken());
        }
        Arrays.sort(arr);
        int ans = Integer.MAX_VALUE;
        ans = Math.min(go(1,arr,n),go(0,arr,n));
        System.out.println(ans);
    }
    public static int go(int type,int[] arr,int n){
        int cnt=0;
        Queue<Integer> q = new LinkedList<>();
        for(int i=0;i<n/2;i++){
            q.add(arr[i]);
        }
        if(type==1){
            //짝수 자리에 넣자.
            for(int i=1;i<=n;i++){
                if(i%2==0){
                    cnt+= Math.abs(q.poll()-i);
                }
            }
        }
        else{
            //홀수 자리에 넣자.
            for(int i=1;i<=n;i++){
                if(i%2==1){
                    cnt+= Math.abs(q.poll()-i);
                }
            }
        }

        return cnt;
    }
}