#include <bits/stdc++.h>
using namespace std;
long long qp(long long a, long long b, long long mod) {
  long long t = 1;
  while (b) {
    if (b & 1) t = t * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return t;
}
struct DOT {
  int x;
  int y;
};
inline void read(int &x) {
  int k = 0;
  char f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) k = k * 10 + c - '0';
  x = k * f;
}
void ex() {
  puts("No");
  exit(0);
}
const int dx[8] = {0, 0, -1, 1, -1, 1, -1, 1};
const int dy[8] = {1, -1, 0, 0, -1, 1, 1, -1};
const int inf = 0x3f3f3f3f;
const long long Linf = 0x3f3f3f3f3f3f3f3fLL;
const long long Mod = 1e18 + 7;
const double eps = 1e-6;
const double pi = acos(-1.0);
const int maxn = 1e2 + 23;
int n;
int a[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n / 2);
  int ans1 = 0;
  for (int i = 1; i <= n / 2; i++) {
    int ned = i * 2;
    ans1 += abs(a[i] - ned);
  }
  int ans2 = 0;
  for (int i = 1; i <= n / 2; i++) {
    int ned = 2 * (i - 1) + 1;
    ans2 += abs(a[i] - ned);
  }
  printf("%d\n", min(ans1, ans2));
}
