#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int c[5100], up;
void update(int x, int v) {
  for (; x <= up; x += x & (-x)) c[x] += v;
}
int getsum(int x) {
  if (x <= 0) return 0;
  int ans = 0;
  for (; x > 0; x -= x & (-x)) ans += c[x];
  return ans;
}
int n, a[5100], sum;
int ans, num;
int main() {
  int i, j, tem;
  while (scanf("%d", &n) != EOF) {
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      a[i]++;
    }
    sum = 0;
    up = n;
    for (i = 1; i <= n; i++)
      for (j = i + 1; j <= n; j++) sum += a[i] > a[j];
    ans = num = 0;
    for (j = 2; j <= n; j++) {
      for (i = 1; i <= n; i++) c[i] = 0;
      for (i = j - 1; i > 0; i--)
        if (a[i] > a[j]) {
          tem = getsum(a[i] - a[j]);
          if (tem > ans) {
            ans = tem;
            num = 1;
          } else if (tem == ans) {
            num++;
          }
          update(a[i] - a[j], 1);
        }
    }
    printf("%d %d\n", sum - 2 * ans - 1, num);
  }
  return 0;
}
