#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e5 + 200;
int p[MAXN];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  sort(p, p + n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += abs(p[i] - i - 1);
  }
  cout << sum << endl;
}
