
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		InputReader reader = new InputReader(System.in);

		int n = reader.nextInt();
		int length = n / 2;

		ArrayList<Integer> myPos = new ArrayList<>();
		ArrayList<Integer> myEven = new ArrayList<>();
		ArrayList<Integer> myOdd = new ArrayList<>();
		for (int i = 1; i <= n; i++) {
			if (i % 2 == 0) {
				myEven.add(i);
			} else {
				myOdd.add(i);
			}
		}

		int countEvenWay = 0;
		int countOddWay = 0;
		for (int i = 0; i < length; i++) {
			myPos.add(reader.nextInt());

		}
		Collections.sort(myPos);
		for (int i = 0; i < length; i++) {
			countEvenWay += Math.abs(myEven.get(i) - myPos.get(i));
			countOddWay += Math.abs(myOdd.get(i) - myPos.get(i));
		}

		if (countEvenWay < countOddWay) {
			System.out.println(countEvenWay);
		} else {
			System.out.println(countOddWay);
		}

	}

	static class InputReader {

		StringTokenizer tokenizer;
		BufferedReader reader;
		String token;
		String temp;

		public InputReader(InputStream stream) {
			tokenizer = null;
			reader = new BufferedReader(new InputStreamReader(stream));
		}

		public InputReader(FileInputStream stream) {
			tokenizer = null;
			reader = new BufferedReader(new InputStreamReader(stream));
		}

		public String nextLine() throws IOException {
			return reader.readLine();
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					if (temp != null) {
						tokenizer = new StringTokenizer(temp);
						temp = null;
					} else {
						tokenizer = new StringTokenizer(reader.readLine());
					}

				} catch (IOException e) {
				}
			}
			return tokenizer.nextToken();
		}

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

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

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