#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main () {
    ios_base::sync_with_stdio(false);
    //freopen("C:\\in.txt","r", stdin);
    int n;
    cin >> n;
    vector<int> v(n);
    for(int i=0; i<n; ++i){
        cin >> v[i];
    }
    int res = 0;
    for(int i=0; i<v.size(); ++i){
        bool panic = true;
        int curr = v[i];
        int prev_smaller = 0;
        int j =i-1;
        while(j>=0 && v[j]<v[j+1] && j>=i-9){
            j--;
            prev_smaller++;
        }
        j = i+1;
        int next_bigge = 0;
        while(j<v.size() && v[j] < v[j-1] && j<=i+9){
            j++;
            next_bigge++;
        }
        if(prev_smaller == 9 && next_bigge==9){
            res++;
        }
    }
    cout << res << endl;
    return 0;
}