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