#include <bits/stdc++.h>
using namespace std;
long long int a[300001] = {0};
int main() {
  long long int n, count = 0, i, j;
  scanf("%I64d", &n);
  for (i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
    if (a[i] < 0) {
      a[i] = -a[i];
      count = count + a[i];
      a[i] = 0;
    }
  }
  sort(a, a + i);
  for (i = 0; i < n; i++) {
    j = i + 1;
    if (a[i] < j) {
      count = count + (j - a[i]);
    } else {
      count = count + (a[i] - j);
    }
  }
  printf("%I64d\n", count);
  return 0;
}
