//package HelloWorld;

import java.util.Arrays;
import java.util.Scanner;

public class HelloWorld {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int a[] = new int[101];
		for(int i = 1;i <= n / 2;++i) {
			a[i] = input.nextInt();
		}
		Arrays.sort(a,1, n / 2 + 1);
		int ans = 334567,res = 0;
		for(int i = 1;i <= n / 2;++i) {
			int x = i * 2;
			res += Math.abs(a[i] - x);
		}

		ans = Math.min(ans, res);
		
		res = 0;
		for(int i = 1;i <= n / 2;++i) {
			int x = i * 2 - 1;
			res += Math.abs(a[i] - x);
		}
		ans = Math.min(ans, res);
		
		System.out.println(ans);
	}
	
	
}