#include <bits/stdc++.h>
using namespace std;
int n, m, x = 0, y = 0;
int a[105];
int main() {
  scanf("%d", &n);
  m = (n >> 1);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + m);
  for (int i = 1; i <= m; i++)
    x += abs((i << 1) - a[i]), y += abs((i << 1) - 1 - a[i]);
  printf("%d\n", min(x, y));
}
