#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const double PI = 3.14159265359;
const double eps = 1e-7;
long long add(long long x, long long y, long long M = MOD) {
  return (x + y + 2 * M) % M;
}
long long mult(long long x, long long y, long long M = MOD) {
  return (add(x, 0, M) * add(y, 0, M)) % M;
}
long long fast_expo(long long x, long long y, long long M = MOD) {
  if (x == 0) return 0;
  if (y == 0) return 1;
  long long res = 1;
  long long mid = fast_expo(x, y / 2, M);
  if (y % 2 != 0) res = x;
  return mult(mult(mid, mid, M), res, M);
}
long long inver(long long x, long long M = MOD) { return fast_expo(x, M - 2); }
long long gcd(long long e1, long long e2) {
  if (e2 == 0) return e1;
  return gcd(e2, e1 % e2);
}
const int TAM = 100 + 5;
int a[TAM];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n / 2 + 1);
  int r1 = 0;
  int r2 = 0;
  for (int i = 2; i <= n; i += 2) {
    r1 += abs(a[i / 2] - i);
    r2 += abs(a[i / 2] - (i - 1));
  }
  cout << min(r1, r2) << endl;
  return 0;
}
