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