#include using namespace std; signed main() { ios::sync_with_stdio(false); int n; cin >> n; vector a(n); for (int i = 0; i < n; ++i) cin >> a[i]; sort(a.begin(), a.end()); int s = 0; for (int i = 0; i < n; ++i) s += abs(i + 1 - a[i]); cout << s << endl; }