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