#include using namespace std; const int NMAX = 100000 + 1; int n; int v[NMAX]; void citeste() { cin >> n; for (int i = 1; i <= n; i++) cin >> v[i]; } void rezolva() { bool ok = false; long long sol = 0; for (int i = 1; i <= n; i++) { ok = true; for (int j = 1; j <= 9 && ok; j++) { if (i - j == 0) ok = false; if (v[i - j] >= v[i - j + 1]) ok = false; } for (int j = 1; j <= 9 && ok; j++) { if (i + j == n + 1) ok = false; if (v[i + j] <= v[i + j + 1]) ok = false; } if (ok) sol++; } cout << sol << '\n'; } int main() { citeste(); rezolva(); return 0; }