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