#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, sum = 0;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  for (long long int i = 0; i < v.size(); ++i) {
    long long int u = i + 1 - v[i];
    if (u < 0) {
      u *= -1;
    }
    sum += u;
  }
  cout << sum << endl;
}
