#include <bits/stdc++.h>
using namespace std;
int a[310000], n;
long long sum;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n);
  sum = 0;
  for (int i = 0; i < n; i++) sum += (long long)abs(a[i] - (i + 1));
  cout << sum << endl;
}
