#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> V;
  vector<int> V1;
  for (int i = 0; i < N; i++) {
    int X;
    cin >> X;
    V.push_back(X);
    V1.push_back(i + 1);
  }
  sort(V.begin(), V.end());
  sort(V1.begin(), V1.end());
  long long Ans = 0;
  for (int i = 0; i < N; i++) {
    Ans += abs(0ll + V[i] - V1[i]);
  }
  cout << Ans << endl;
  return 0;
}
