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