#include #define forn(i,s,t) for(int i=(s); i<=(t); ++i) #define form(i,s,t) for(int i=(s); i>=(t); --i) #define rep(i,s,t) for(int i=(s); i<(t); ++i) using namespace std; typedef long long i64; const int N = 2e5 + 5; i64 ans; int n; i64 a[N], r[N], pre[N], suf[N], Pr[N], Sf[N]; int main() { ios::sync_with_stdio(false); cin.tie(0), cout.tie(0); cin >> n; ans = 1e18; forn (i, 1, n) cin >> a[i]; forn (i, 1, n) if (a[i] > n / 2) r[i] = 1; forn (i, 1, n) if (i & 1) Pr[i] = 1; else Sf[i] = 1; forn (i, 1 ,n) pre[i] = r[i] + pre[i - 1], Pr[i] += Pr[i - 1]; form (i, n, 1) suf[i] = r[i] + suf[i + 1], Sf[i] += Sf[i + 1]; if (n & 1) { ans = 0; forn (i, 1, n) ans += abs(Pr[i] - pre[i]); } else { forn (i, 1, n) Pr[i] = Pr[i - 1] + abs(Pr[i] - pre[i]); form (i, n, 1) Sf[i] = Sf[i + 1] + abs(Sf[i] - suf[i]); forn (i, 0, n) ans = min(ans, Pr[i] + Sf[i + 1]); } cout << (n / 2) << ' ' << ans << '\n'; return 0; } /* */