#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, H[100];
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> H[i];
  int ans = 1;
  int i = 2;
  while ((i <= N) && ((H[0] <= H[i]) && (H[1] <= H[i]) && (H[i - 1] <= H[i]))) {
    ans++;
    cout << i << ", " << H[i] << endl;
    i++;
  }
  cout << (H[1] <= H[i]) << endl;
  cout << (H[2] <= H[i]) << endl;
  cout << (H[i - 1] <= H[i]) << endl;
  cout << ans << endl;
  return 0;
}
