import java.util.*;
public class Chess_Placing
{
    public static void main(String args[])
    {
        Scanner s1 = new Scanner(System.in);
        int n = s1.nextInt();
        int p[] = new int[n/2];
        for(int i=0;i<n/2;i++)
            p[i] = s1.nextInt();
        Arrays.sort(p);
        int odd[] = new int[n/2];
        int ct = 1;
        for(int i=0;i<n/2;i++)
        {
            odd[i] = ct;
            ct += 2;
        }
        ct = 2;
        int even[] = new int[n/2];
        for(int i=0;i<n/2;i++)
        {
            even[i] = ct;
            ct += 2;
        }
        int oct= 0,ect = 0;
        for(int i=n/2-1;i>=0;i--)
        {
            oct += Math.abs((odd[i] - p[i]));
            ect += Math.abs((even[i] - p[i]));
        }
        System.out.println(Math.min(oct,ect));
        s1.close();
    }
}