/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc = new Scanner(System.in) ;
		int n = sc.nextInt() ;
		int arr[] = new int[n/2] ;
		for(int i = 0 ; i < n/2 ; i++)
		arr[i] = sc.nextInt() ;
		int k = 1 ;
		int odd = 0 ; 
		int even = 0 ;
		for(int i = 0 ; i < n/2 ;i++){
			odd+= (int)Math.abs(k - arr[i]) ;
			k+=2 ;
		}
		k = 2 ;
		for(int i = 0 ;i < n/2 ;i++){
			even+= (int)Math.abs(k - arr[i]) ;
			k+=2 ;
		}
			System.out.println( even> odd ? odd : even ) ;
	}
}