#include using namespace std; const int MAX_N = 1e5 + 10; int n; int v[MAX_N]; bool ok(int i) { for(int j = 1; j <= 9; ++j) { if(v[i - j] < v[i - j + 1]) continue; return 0; } for(int j = 1; j <= 9; ++j) { if(v[i + j - 1] > v[i + j]) continue; return 0; } return 1; } int main() { cin >> n; for(int i = 1; i <= n; ++i) cin >> v[i]; int sol = 0; for(int i = 10; i <= n; ++i) sol += ok(i); cout << sol << "\n"; return 0; }