#include <bits/stdc++.h>
using namespace std;
const int siz = 1e6;
int a[siz], n;
long long ans;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    if (a[i] == i + 1)
      ans += 0;
    else
      ans += abs((i + 1) - a[i]);
  }
  cout << ans;
  return 0;
}
