#include <bits/stdc++.h>
using namespace std;
typedef long long int64;
typedef unsigned long long uint64;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int MAXI = 0x7fffffff;
int in() {
  int x = 0, c;
  for (; (unsigned)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -in();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned)((c = getchar()) - '0') < 10);
  return x;
}
int main(int argc, char *argv[]) {
  int64 n;
  cin >> n;
  int64 a[n], re[n];
  for (int i = (0), _b = (n); i < _b; i++) {
    cin >> a[i];
    re[i] = i + 1;
  }
  sort(a, a + n);
  int64 cnt;
  cnt = 0;
  for (int i = (0), _b = (n); i < _b; i++) cnt += abs(re[i] - a[i]);
  cout << cnt;
  return 0;
}
