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