#include using namespace std; int main() { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) cin >> A.at(i); sort(A.begin(), A.end()); int sum = 0; for (int i = 0; i < N; i++) sum += abs(A.at(i) - (i + 1)); cout << sum << "\n"; }