#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; rep(i,0,m){ if (N%2 == 0 && i == m-1 && b[i] != N){ ans --; } ans += abs(2*i+1-b[i]); } if (N % 2 == 0){ ll aa = 0; rep(i,0,m){ if (N%2 == 0 && i == 0 && b[i] != 0){ aa --; } aa += abs(2*i-b[i]); } ans = min(aa,ans); } cout << m << " " << ans << endl; //system("pause"); return 0; }