#include <bits/stdc++.h>
using namespace std;
void huh() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  huh();
  long long n, x;
  cin >> n;
  multiset<long long> ms;
  for (int i = 0; i < n; i++) {
    cin >> x;
    ms.insert(x);
  }
  multiset<long long>::iterator it = ms.begin();
  long long cnt = 0;
  for (int i = 1; i <= n; i++, it++) {
    cnt += abs(*it - i);
  }
  cout << cnt << endl;
  return 0;
}
