#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b A){ ll L = A.size(); FOR(i, 0, L){ if(i) cout << ' '; cout << A[i]; } cout << endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input ll N; cin >> N; vector A(N); FOR(i, 0, N){ cin >> A.at(i); } sort(ALL(A)); ll sum = 0; FOR(i, 0, N){ ll target = i+1; ll now = A[i]; ll diff = abs(target - now); sum += diff; } p(sum); return 0; }