//Working program with FastReader 
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer; 

public class Main 
{
public static void main(String[] args) 
 { 
     

     // start from here.
    FastReader s=new FastReader(); 
    int n = s.nextInt();
    int input[] = new int[n/2];
    for(int i = 0;i<n/2;i++) {
        input[i] = s.nextInt();
    }
    
    Arrays.sort(input);
    
    ArrayList<Integer> emptyOne, emptyTwo, fillOne, fillTwo;
    emptyOne = new ArrayList<Integer>();
    emptyTwo = new ArrayList<Integer>();
    fillOne = new ArrayList<Integer>();
    fillTwo = new ArrayList<Integer>();
    
    for(int i = 0, j = 1;j<=n;j++) {
        if(i< n/2 && input[i] == j) {
                if((j&1) != 0) fillOne.add(j);
                else fillTwo.add(j);
            i++;
        }
        else {
            if((j&1) != 0 ) emptyOne.add(j);
            else emptyTwo.add(j);
        }
    }
    // cost of placing on position starting from 1- fillTwo, emptyOne.
    if(fillTwo.size() != emptyOne.size() || fillOne.size() != emptyTwo.size())
        throw new IllegalArgumentException("size should have come equal - " + fillTwo.size() + " , " + emptyOne.size() + " , " + fillOne.size() + " , " + emptyTwo.size());
    int cost1  =0 ,cost2 = 0,cost = 0;
    for(int i = 0;i<fillTwo.size();i++) {
        cost1 += Math.abs(fillTwo.get(i) - emptyOne.get(i));
    }
    
    for(int i = 0;i<fillOne.size();i++) {
        cost2 += Math.abs(fillOne.get(i) - emptyTwo.get(i));
    }
    
    cost = Math.min(cost1, cost2);
    System.out.println(cost);
 }
static class FastReader 
 { 
     BufferedReader br; 
     StringTokenizer st; 

     public FastReader() 
     { 
         br = new BufferedReader(new
                  InputStreamReader(System.in)); 
     } 

     String next() 
     { 
         while (st == null || !st.hasMoreElements()) 
         { 
             try
             { 
                 st = new StringTokenizer(br.readLine()); 
             } 
             catch (IOException  e) 
             { 
                 e.printStackTrace(); 
             } 
         } 
         return st.nextToken(); 
     } 

     int nextInt() 
     { 
         return Integer.parseInt(next()); 
     } 

     long nextLong() 
     { 
         return Long.parseLong(next()); 
     } 

     double nextDouble() 
     { 
         return Double.parseDouble(next()); 
     } 

     String nextLine() 
     { 
         String str = ""; 
         try
         { 
             str = br.readLine(); 
         } 
         catch (IOException e) 
         { 
             e.printStackTrace(); 
         } 
         return str; 
     } 
 }
}