#include using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; template using vc = vector; template using vvc = vc>; using pi = pair; using vi = vc; using vvi = vvc; #define rep(i,a,b) for (int i = a; i < b; i++) #define irep(i,a,b) for (int i = a; i > b; i--) #define print(n) cout << n << endl #define rup(a,b) (a+b-1)/b int main(){ cout << fixed << setprecision(15); int N ; cin >> N; vi a(N); rep(i,0,N) cin >> a[i]; int m = N / 2; vi b(N); int now = 0; rep(i,0,N){ if (a[i]>m) continue; b[now] = i; now ++ ; } ll ans = 0; vc c(m); rep(i,0,m){ ans += abs(2*i+1-b[i]); c[i] = ans; } if (N%2 == 0){ ll aa = ans; ll na = 0; irep(i,m-1,-1){ na += ans += abs(2*i+1-b[i]); if (i!=0){ aa = min(aa,na+b[i-1]); }else{ aa = min(aa,na); } } ans = aa; } cout << m << " " << ans << endl; //system("pause"); return 0; }