#include <bits/stdc++.h>
using namespace std;
long long N, A[3000011], sum2;
long long sum, Tsum = 0, Ans;
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  sort(A, A + N);
  for (int i = 0; i < N; i++) {
    sum += abs(A[i] - i - 1);
  }
  cout << sum << endl;
  return 0;
}
