#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 7;
long long mas[maxn];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> mas[i];
  std::sort(mas + 1, mas + n + 1);
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    if (mas[i] != i) ans += abs(i - mas[i]);
  cout << ans << endl;
  return 0;
}
