#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  long long int j = 1, cnt = 0;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  while (j <= n) {
    cnt += abs(j - a[j - 1]);
    j++;
  }
  cout << cnt << endl;
  return 0;
}
