import java.util.*;
import java.math.*;
import java.util.Arrays;
import java.io.*;
import java.util.Scanner;
import java.math.BigInteger;
import java.math.BigDecimal;
public class Main
{
    public static int abs(int num)
    {
        if(num<0)num=-num;
        return num;
    }
    public static int min(int A,int B)
    {
        return A<B?A:B;
    }
    public static void main(String [] args)
    {
        Scanner cin = new Scanner(System.in);
        int n=cin.nextInt();
        int [] a=new int[105];
        for(int i=1;i<=n/2;i++)
        cin.nextInt();
        int s=0,b=0;
        for(int i=1;i<=n/2;i++)
        {
            s+=abs(2*i-a[i]);
            b+=abs(2*i-1-a[i]);
        }
        System.out.println(min(s,b));
    }
}