 import java.io.*;
    import java.util.*;
   
    	
        public class Codeforces {
    	
    		   public static long log2(long x)
    			{
    				long p=1;
    				long ans=0;
    				while(x>=p)
    				{
    					p*=2;
    					ans++;
    				}
    				return ans-1;
    			}
    		   
    		   
    		   public static void extendedgcd(int a, int b)
    		   {
    			   x=0;
    			   y=0;
    			   gc=0;
    			   xgcd(a,b);
    			   pw.println(a+"*"+x+" + "+b+"*"+y+" = "+gc);
    			   
    		   }
    		   
    		   
    		   public static long modex(long a, long b, long c)
    		   {
    			   if(b==0)
    				   return 1;
    			   else if(b==1)
    				   return a%c;
    			   else if(b%2==0)
    			   {
    				   	return modex((a*a)%c,b/2,c);
    			   }
    			   else
    			   {
    				   return (a*modex((a*a)%c,b/2,c))%c;
    				   
    			   }
    			   
    			   
    		   }
    		   
    		   
    		   public static void xgcd(int a, int b)
    		   {
    			   
    			   if(b==0)
    			   {
    				   x=1;
    				   y=0;
    				   gc=a;
    				   
    				   
    			   }
    			   else
    			   {
    				   xgcd(b,a%b);
    				   int temp = x;
    				   x=y;
    				   y = temp - ((a/b)*y);
    				   
    			   }
    		   }
    		   
    		   public static long gcd(long a, long b)
    		   {
    			   if(b==0)return a;
    			   else return gcd(b,a%b);
    			   
    		   }
    		   
    		   static int x,y,gc;
    		   
    		  
    		
    		   
    		   static HashSet<Character> set;
    		   
    		   
    		   
    		   public static int expmod(int a, int b, int mod)
    		   {
    			   if(b==0)return 1;
    			   if(b==1)return a;
    			   
    			   if(b%2==0)
    			   {
    				   return ((expmod(a,b/2,mod)%mod)*(expmod(a,b/2,mod)%mod))%mod;
    			   }
    			   else
    			   {
    				   return ((a%mod)*(expmod(a,b/2,mod)%mod)*(expmod(a,b/2,mod)%mod))%mod;
    			   }
    		   }
    		   
    		   static class Comp implements Comparator<Point>
    		   {

				@Override
				public int compare(Point arg0, Point arg1) {
					
					if(arg0.x>arg1.x)return 1;
					if(arg0.x<arg1.x)return -1;
					return 0;
				}
    			   
    		   }
    		   
    		   
    		   static class STComp implements Comparator<String>
    		   {

				@Override
				public int compare(String arg0, String arg1) {
					
					if(arg0.length()>arg1.length())return 1;
					if(arg0.length()<arg1.length())return -1;
					return 0;
				}
    			   
    		   }
    		   
    		   static class Point
    		   {
    			   int x,y,ind;
    			   
    			    public Point(int a, int b, int i)
    			    {
    			    	x=a;
    			    	y=b;
    			    	ind=i;
    			    }
    			   
    			    
    		   }
    		   
    		   
    		   public static int getsub(int node)
    		   {
    			   vis[node]=1;
    			   ArrayList<Integer> li = adj[node];
    			   
    			   int subtr=0;
    			   
    			   for(int ch:li)
    			   {
    				   if(vis[ch]==0)
    				   {
    					   int nodsubtree = getsub(ch);
    					   if(nodsubtree%2==0)ans++;
    					   subtr+=nodsubtree;
    				   }
    				   
    				   
    			   }
    			   
    			   
    			   return subtr+1;
    			   
    		   }
    		   
    		   static ArrayList<Integer>[] adj;
    		   static int[] vis;
    		   static int ans;
    		
    		   
    		   public static boolean issub(String s1, String s2)
    		   {
    			   if(s1.length()>s2.length())
    			   return false;
    			   
    			   int l1 = s1.length();
    			   int l2 = s2.length();
    			   
    			   
    			   for(int i=0;i<=l2-l1;i++)
    			   {
    				   String sub = s2.substring(i, i+l1);
    				   if(s1.equals(sub))return true;
    			   }
    			   
    			   return false;
    		   }
    		   
    		   
    		   public static void main(String[] args) 
    	   {
    			  //a=97
    			  int n = sc.nextInt();
    			 int occ[] = new int[n/2+1];
    			 
    			 for(int i=1;i<=n/2;i++)occ[i]=sc.nextInt();
    			 
    			 int c1=0;
    			 
    			 int end = n/2;
    			 int j = n;
    			 
    			 
    			 while(j>=1&&end>=1)
    			 {
    				 c1+=Math.abs(j-occ[end]);
    				 //pw.println("c1 "+(j-occ[end]));
    				 j-=2;
    				 end--;
    			 }
    			 
    			 int c2=0;
    			 
    			 int end2 = n/2 ;
    			 int j2 = n -1;
    			 
    			 
    			 while(j2>=1&&end2>=1)
    			 {
    				 c2+=Math.abs(j2-occ[end2]);
    				// pw.println("c2 "+(j2-occ[end2]));
    				 j2-=2;
    				 end2--;
    			 }
    			  
    			  
    			 pw.println(Math.min(c1,c2));
    			  
    			pw.close();  
    			   
    	   }
    		    		   
    		   static  class MyScanner 
    			{
    	
    			BufferedReader br;
    			StringTokenizer st;
    	
    			public MyScanner() 
    			{
    				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;
    			}
    	
    		}
    	
    		static MyScanner sc = new  MyScanner();
    		static PrintWriter pw = new PrintWriter(System.out, true);
    		
    	
    	
    		
    	}  