func_code_string: #include <bits/stdc++.h>   using namespace std;   void solve() {     long long n;     cin >> n;     long long a[n];     for (long long i = 0; i < n; i++) {       cin >> a[i];     }     sort(a, a + n);     long long moves = 0;     for (long long i = 0; i < n; i++) {       if (a[i] < 1) {         moves = moves + (i + 1) - a[i];       } else if (a[i] > n) {         moves = moves + (a[i] - (i + 1));       } else if (a[i] > (i + 1)) {         moves = moves + (a[i] - (i + 1));       } else {         moves = moves + (i + 1 - a[i]);       }     }     cout << moves;   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.tie(NULL);     long long t = 1;     while (t--) {       solve();       cout <<   n ;     }     cerr <<  time taken:   << (float)clock() / CLOCKS_PER_SEC << endl;     return 0;   }   