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