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