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