#include <bits/stdc++.h>
using namespace std;
long long a[300005], n, g, s, j, k, l = 1, i;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) s = s + abs(i - a[i]);
  cout << s;
}
