#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const unsigned long long INF = 1e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += abs(v[i - 1] - i);
  }
  cout << ans;
}
