import java.util.Arrays;
import java.util.Scanner;

public class a{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int p[] = new int[n/2];
        for(int i=0;i<n/2;++i)p[i]=scan.nextInt();
        Arrays.sort(p);
        int ans = Integer.MAX_VALUE;
        int tmp=0;
        for(int i=0;i<n/2;++i)tmp+=Math.abs(p[i]-(2*i+1));
        ans=Math.min(ans, tmp);
        tmp=0;
        for(int i=0;i<n/2;++i)tmp+=Math.abs(p[i] - (2*i+2));
        System.out.println(Math.min(ans, tmp));
    }
}