#include <bits/stdc++.h>
using namespace std;
int a[300008];
int cmp(int a, int b) { return a < b; }
int main() {
  int i, n;
  long long m = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n, cmp);
  for (i = 0; i < n; i++) {
    if (a[i] > i + 1)
      m = m + (a[i] - i - 1);
    else if (a[i] < i + 1)
      m = m + (i + 1 - a[i]);
  }
  printf("%I64d\n", m);
  return 0;
}
