#include using namespace std; typedef long long ll; int main() { int n; cin >> n; int a[200005]; for (int i = 0; i < n; i++) { cin >> a[i]; } int c = 0; ll dp[2] = {0, 0}; for (int i = 0; i < n; i++) { if (a[i] > n / 2) { continue; } dp[1] = min(dp[1], dp[0]) + abs(i - (c * 2)); dp[0] = dp[0] + abs(i - (c * 2 + 1)); c++; } cout << n / 2 << " " << (n % 2 ? dp[0] : min(dp[0], dp[1])) << endl; }