#include <bits/stdc++.h>
using namespace std;
int fx[] = {0, 0, -1, 1, -1, 1, -1, 1};
int fy[] = {-1, 1, 0, 0, 1, 1, -1, -1};
int Set(int n, int pos) { return n = n | (1 << pos); }
int reset(int n, int pos) { return n = n & ~(1 << pos); }
bool check(int n, int pos) { return (bool)(n & (1 << pos)); }
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
};
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); };
int main() {
  int n, a;
  scanf("%d", &n);
  vector<int> v;
  for (int i = 1; i <= n / 2; i++) {
    scanf("%d", &a);
    v.push_back(a);
  }
  int b = 0, w = 0;
  int curr = 1;
  sort(v.begin(), v.end());
  for (int i = 0; i < n / 2; i++) {
    b += abs(curr - v[i]);
    curr += 2;
  }
  curr = 2;
  for (int i = 0; i < n / 2; i++) {
    w += abs(curr - v[i]);
    curr += 2;
  }
  printf("%d\n", min(b, w));
}
