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