#include <bits/stdc++.h>
int dx[] = {-1, -1, -1, 0, 1, 1, 1, 0};
int dy[] = {-1, 0, 1, 1, 1, 0, -1, -1};
using namespace std;
long long power(long long a, long long p, long long M) {
  long long r = 1;
  a = a % M;
  while (p > 0) {
    if (p % 2) r = (r * a) % M;
    a = (a * a) % M;
    p /= 2;
  }
  return r % M;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  long long n;
  cin >> n;
  long long arr[n + 5];
  for (long long i = 0; i < n; i++) scanf("%lld", &arr[i]);
  ;
  sort(arr, arr + n);
  long long ans = INT_MAX, cur = 0, j = 0;
  for (int i = 1; i <= n; i += 2) {
    cur += abs(i - arr[j]);
    j++;
  }
  ans = cur;
  cur = 0, j = 0;
  for (int i = 2; i <= n; i += 2) {
    cur += abs(i - arr[j]);
    j++;
  }
  cout << min(ans, cur) << endl;
}
int main() {
  solve();
  return 0;
}
