#include <bits/stdc++.h>
using namespace std;
int dirx[] = {-1, -1, -1, 0, 0, 1, 1, 1};
int diry[] = {-1, 0, 1, -1, 1, -1, 0, 1};
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long arr[n];
  long long ans = 0;
  for (long long i = 0; i < n; ++i) cin >> arr[i];
  sort(arr, arr + n);
  for (long long i = 0; i < n; ++i) {
    ans += abs((i + 1) - arr[i]);
  }
  cout << ans;
}
