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