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