import java.io.IOException;
import java.awt.color.*;
import java.util.*;
import java.math.*;
import java.io.*;
import java.util.InputMismatchException;	

@SuppressWarnings("unused")
public class main {	int[][] ar=new int[10][10];
	public static void main(String[] args) {
                new main().solve();
                                  }
            public void solve() {
           int n=sc.nextInt();
           int[] a=new int[n+1];
           for(int i=0;i<n/2;i++) {
        	   a[sc.nextInt()]++;
           }int sum1=0;int sum2=0;int j=1;int k=2;
           for(int i=1;i<=n;i++) {
        	   if(a[i]!=0) {
        		   sum1+=Math.abs(i-j);j=j+2;
        		   sum2+=Math.abs(i-k);k=k+2;
        	   }
        	   
           }
           System.out.println(Math.min(sum1, sum2));
           
           
           
         
       }         
         
            
            
            
            
            
            
            public int bfs(HashSet<Integer>[] adil,int n){
                int c=0;
                int[] shortdis=new int[n+1];
                Arrays.fill(shortdis,(int)1e5);
                LinkedList<Integer> queue=new LinkedList<Integer>();
                queue.add(1);
                shortdis[1]=0;
                while(queue.size()!=0){
                       int cc=queue.removeFirst();
                       Iterator<Integer> it=adil[cc].iterator();
                       while(it.hasNext()){
                              int f=it.next();
                              if(shortdis[f]==1e5){
                                     shortdis[f]=shortdis[cc]+1;
                                     queue.add(f);
                              }
                       }
                }
                return(shortdis[n]);
         }         
            
          /*  boolean[] sieveOfEratosthenes(int n)
            {
            	
                // (a / b) % m = (a % m * b^(m - 2) % m) % mCreate a boolean array "prime[0..n]" and initialize
                // all entries it as true. A value in prime[i] will
                // finally be false if i is Not a prime, else true.
                boolean prime[] = new boolean[n+1];
                for(int i=0;i<n;i++)
                    prime[i] = true;
                 
                for(int p = 2; p*p <=n; p++)
                {
                    // If prime[p] is not changed, then it is a prime
                    if(prime[p] == true)
                    {
                        // Update all multiples of p
                        for(int i = p*2; i <= n; i += p)
                            prime[i] = false;
                    }
                }
                 
                // Print all prime numbers
               return prime;
            }
            
   /*         void DFS(int v,boolean visited[])
    {
        // Mark the current node as visited and print it
        visited[v] = true;
        System.out.print(v+" ");
 
        // Recur for all the vertices adjacent to this vertex
        Iterator<Integer> i = adj[v].listIterator();
        while (i.hasNext())
        {
            int n = i.next();
            if (!visited[n])
                DFS(n, visited);
        }
    }*/
    /*static int binomialCoeff(int n, int k)
    {
        int C[] = new int[k + 1];
        
        // nC0 is 1
        C[0] = 1;  
      
        for (int i = 1; i <= n; i++)
        {
            // Compute next row of pascal 
            // triangle using the previous row
            for (int j = Math.min(i, k); j > 0; j--)
                C[j] = C[j] + C[j-1];
        }
        return C[k];
    }*/
         
          FastReader sc=new FastReader();
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;
        }
    }}