#include<bits/stdc++.h>
using namespace std;
 
#define int long long
typedef long long ll;  
typedef vector<ll> vi; 
typedef pair<int, int> ii; 
typedef vector<ii> vii; 
typedef vector<vi> vvi;
#define F first
#define S second
#define pb emplace_back
#define M 1000000007
#define watch(x) cout << (#x) << " is " << (x) << endl
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fr(i,a,b) for(int i = a; i<= b; i++)
#define ws " "
#define all(c) c.begin(), c.end()
#define ln "\n" 
 
main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
 
    int n;
    cin >> n;
    int ar[n / 2];
    for (int i = 0; i <= n / 2; i++) {
        cin >> ar[i];
    }
    sort(ar, ar + n);
    // odd
    int odd = 0, it = 0;
    for (int i = 1; i <= n; i += 2) {
        odd += abs(i - ar[it++]);
    }
    it = 0;
    int e = 0;
    for (int i = 2; i <= n; i += 2) {
        e += abs(i - ar[it++]);
    }
    cout << min(odd,e);
 
#ifndef ONLINE_JUDGE
cout << "\nTime Elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " s\n";
#endif
}
 
/*  Check for base cases such as n == 1
    and cases like it where code can fail */
 
