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