#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int res = 0, a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (long long int i = 0; i < n; i++) res += (abs(a[i] - i - 1));
  cout << res;
  return 0;
}
