#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you const int INF = 999999999; const int MOD = 1e9 + 7; const double pi = 3.141592653589793238; int n, sum, k[55]; int main() { cin >> n; for (int i = 0; i < n; ++i) { cin >> k[i]; } sort(k, k + n); for (int i = 0; i < n; ++i) { sum += abs(k[i] - i - 1); } cout << sum << endl; }