#include <bits/stdc++.h>
using namespace std;
struct node {
  int money, price;
} people;
bool cmp(node a, node b) { return a.money < b.money; }
int main() {
  int n;
  while (cin >> n) {
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      ans += abs(a[i] - (i + 1));
    }
    cout << ans << endl;
  }
}
