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

public class CF985A {
    public static void main(String args[]) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] s = br.readLine().split(" ");
        int n = Integer.parseInt(s[0]);
        s = br.readLine().split(" ");
        int[] a = new int[s.length];
        for(int i=0;i<a.length;i++){
            a[i] = Integer.parseInt(s[i]) - 1;
        }
        Arrays.sort(a);
        int odd = 0, even = 0;
        int a_ = 0, b_ = 1;
        for(int i=0;i<a.length;i++){
            odd += (int)Math.abs(a_-a[i]);
            even += (int)Math.abs(b_-a[i]);
            a_+=2;
            b_+=2;
        }
        System.out.println(Math.min(odd, even));
    }
}
