#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, s = 0;
  cin >> n;
  long long int 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++) s = s + abs(a[i] - i - 1);
  cout << s;
}
