#include #include using namespace std; using namespace atcoder; using mint = modint998244353; using ll = long long; #define all(x) x.begin(), x.end() #define rep(i, n) for (int i = 0; i < n; i++) int main(void) { int n; cin >> n; vector a(n); rep(i, n) cin >> a[i]; ll x, y; x = n / 2; vector ind; rep(i, n){ if (a[i] <= x) ind.push_back(i); } if(n % 2){ y = 0; rep(i, x){ y += abs(ind[i] - 2 * i - 1); } } else{ ll y1 = 0; ll y2 = 0; rep(i, x){ y1 += abs(ind[i] - 2 * i - 1); y2 += abs(ind[i] - 2 * i); } y = min(y1, y2); } cout << x << ' ' << y << endl; return 0; }