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