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