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