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