#include <bits/stdc++.h>
using namespace std;
const int N = 312345;
int n;
long long v[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> v[i];
  sort(v, v + n);
  long long next = 1;
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    ans += llabs(v[i] - next);
    ++next;
  }
  cout << ans << "\n";
  return 0;
}
