#include using namespace std; using ll = long long; int main () { int N; cin >> N; std::vector A(N); for (auto a : A) { cin >> a; } cout << N / 2 << " "; if (N % 2) { ll ans = 0; ll now = 1; for (int i = 0; i < N; i ++) { if (A[i] <= N / 2) { ans += abs(now - i); now += 2; } } cout << ans << endl; } else { ll ans1 = 0; ll now = 0; vector B(N / 2); for (int i = 0; i < N; i ++) { if (A[i] <= N / 2) { B[now] = i - now * 2; now ++; ans1 += abs(B[now]); } } ll ans2 = 0; now = 0; for (int i = 0; i < N / 2; i ++) { if (B[i] > 0) { now --; } else { now ++; } ans2 = min(ans2, now); } cout << ans2 + ans1 << endl; } }