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

public class Solution
{
    public static void main(String[] args) throws IOException
    {
        FastReader in=new FastReader(System.in);
        int n=in.nextInt();
        Long[] arr=new Long[n/2];
        for(int i=0;i<n/2;i++)
            arr[i]=in.nextLong();
        Arrays.sort(arr);
        long anso=0,anse=0,ans=0,j=1;
        for(int i=0;i<n/2;i++)
        {
            anso+=Math.abs(arr[i]-j);
            j+=2;
        }
        j=2;
        for(int i=0;i<n/2;i++)
        {
            anse+=Math.abs(arr[i]-j);
            j+=2;
        }
        ans=Math.min(anso,anse);
        System.out.println(ans);
    }
}

class Graph
{
    private int V;
    private ArrayList<Integer> adj[];
    private static Set<Integer> visited;
    
    public Graph(int v)
    {
        V=v+1;
        adj=new ArrayList[V];
        visited=new HashSet<>();
        for(int i=1;i<=v;i++)
            adj[i]=new ArrayList<>();
    }
    
    public void addEdge(int a,int b)
    {
        adj[a].add(b);
        adj[b].add(a);
    }
    
    public int dfs(int a)
    {
        int r=1;
        if(visited.contains(a))
            return 0;
        else if(adj[a].size()!=2)
            return 0;
        visited.add(a);
        for(int i=0;i<adj[a].size();i++)
        {
            if(!visited.contains(adj[a].get(i)))
                r=dfs(adj[a].get(i));
        }
        return r;
    }
}

class FastReader
{
    static BufferedReader br;
    static StringTokenizer st;
    
    public FastReader(InputStream in) throws IOException
    {
        br=new BufferedReader(new InputStreamReader(in));
    }
    
    static String next() throws IOException
    {
        if(st==null || !st.hasMoreElements())
        {
            st=new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
    static int nextInt() throws IOException
    {
        return Integer.parseInt(next());
    }
    
    static long nextLong() throws IOException
    {
        return Long.parseLong(next());
    }
    
    static String nextLine() throws IOException
    {
        return br.readLine();
    }
    
    static double nextDouble() throws IOException
    {
        return Double.parseDouble(next());
    }
}