import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String[] sa = br.readLine().split(" "); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = Integer.parseInt(sa[i]); } br.close(); int n2 = n / 2; System.out.print(n2 + " "); if (n % 2 == 1) { long ans = 0; int idx = 1; for (int i = 0; i < n; i++) { if (a[i] <= n2) { ans += Math.abs(idx - i); idx += 2; } } System.out.println(ans); } else { long[] dp1 = new long[n + 1]; long[] dp2 = new long[n + 1]; int idx1 = 0; int idx2 = 1; for (int i = 0; i < n; i++) { if (a[i] <= n2) { long v1 = dp1[i] + Math.abs(idx1 - i); long v2 = dp2[i] + Math.abs(idx1 - i); long v3 = dp2[i] + Math.abs(idx2 - i); dp1[i + 1] = Math.min(v1, v2); dp2[i + 1] = v3; idx1 += 2; idx2 += 2; } else { dp1[i + 1] = dp1[i]; dp2[i + 1] = dp2[i]; } } System.out.println(Math.min(dp1[n], dp2[n])); } } }