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