#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  long long *arr = new long long[n];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  long long ans = 0;
  sort(arr, arr + n);
  for (int i = 0; i < n; ++i) {
    ans += abs(i + 1 - arr[i]);
  }
  cout << ans;
  return 0;
}
