#include <bits/stdc++.h>   using namespace std;   void solve() {     long long n;     cin >> n;     long long ar[n];     for (long long i = 0; i < n; i++) cin >> ar[i];     sort(ar, ar + n);     long long dist = 0;     for (long long i = 0; i < n; i++) dist += (long long)abs(ar[i] - (i + 1));     cout << dist <<   n ;   }   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     long long T = 1;     while (T--) solve();     return 0;   }   