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