import java.util.*;
import java.io.*;

public class Solution {
    public static void main(String[] args) throws IOException {
        try (FastInputScanner input = new FastInputScanner(System.in)) {
            int n = input.nextInt();
            int[] pos = new int[n / 2];
            
            for (int i = 0; i < n / 2; ++i)
                pos[i] = input.nextInt();
            
            Arrays.sort(pos);
            
            int ans1 = 0;
            int bag = 2;
            for (int p : pos) {
                ans1 += Math.abs(p - bag);
                bag += 2;
            }
            
            int ans2 = 0;
            bag = 1;
            for (int p : pos) {
                ans2 += Math.abs(p - bag);
                bag += 2;
            }
            
            System.out.printf("%d\n", Math.min(ans1, ans2));
        }
    }
}

class FastInputScanner implements Closeable {
    public static final int DEFAULT_BUFFER_SIZE = 4096;
    
    private BufferedReader _reader;
    private char[] _buf;
    private int _p, _end;
    private char _next;
    
    public FastInputScanner(InputStream stream, int bufferSize) {
        _reader = new BufferedReader(new InputStreamReader(stream));
        _buf = new char[bufferSize];
        _p = 0;
        _end = 0;
        _next = 0;
    }
    
    public FastInputScanner(InputStream stream) {
        this(stream, DEFAULT_BUFFER_SIZE);
    }

    private boolean readNextChar() throws IOException {
        if (_p == _end) {
            _end = _reader.read(_buf, 0, _buf.length);
            if (_end == -1) {
                _next = 0;
                return false;
            }
            _p = 0;
        }
        _next = _buf[_p++];
        return true;
    }
    
    public int nextInt() throws IOException {
        int number = 0;
        while (readNextChar() && Character.isWhitespace(_next))
            ;
        while (Character.isDigit(_next)) {
            number = number * 10 + _next - '0';
            if (!readNextChar())
                break;
        }
        
        return number;
    }
    
    public long nextLong() throws IOException {
        long number = 0;
        while (readNextChar() && Character.isWhitespace(_next))
            ;
        while (Character.isDigit(_next)) {
            number = number * 10 + _next - '0';
            if (!readNextChar())
                break;
        }
        
        return number;
    }

    @Override
    public void close() throws IOException {
        _reader.close();
    }
}

