#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[105];
  while (~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, j = 1; i <= n / 2; i++, j += 2) ans1 += fabs(a[i] - j);
    int ans2 = 0;
    for (int i = 1, j = 2; i <= n / 2; i++, j += 2) ans2 += fabs(a[i] - j);
    printf("%d\n", min(ans1, ans2));
  }
  return 0;
}
