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

public class Solutio {

    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int size=s.nextInt();
        int a[]=new int[size/2];
        for(int i=0;i<size/2;i++)
        {
            a[i]=s.nextInt();
        }
        for(int i=0;i<size/2;i++)
        {
            int temp=i;
            for(int j=i;j<size/2;j++)
                {
                    if(a[j]<a[i])
                    {    
                        temp=j;
                    }
                }
            int temp1=a[i];
            a[i]=a[temp];
            a[temp]=temp1;
            
        }
        int anseven=0;
        int ansodd=0;
        int k=0;
        for(int i=1;i<=size;i=i+2)
            ansodd +=Math.abs(a[k++]-i);
        k=0;
        for(int i=2;i<=size;i=i+2)
            anseven +=Math.abs(a[k++]-i);
        
        if(ansodd<anseven)
            System.out.println(ansodd);
        else
            System.out.println(ansodd);
    }
    
    }
