#include #include #include #include void solve() { int n; std::cin >> n; std::vector xs(n); for (auto& x : xs) std::cin >> x; std::sort(xs.begin(), xs.end()); int ans = 0; for (int i = 0; i < n; ++i) { ans += std::abs(xs[i] - (i + 1)); } std::cout << ans << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }