#include <iostream>
#include <cstdio>

using namespace std;

#define DIM 100005

int V[DIM];

int check(int pos) {
    for(int i = pos - 1; i >= pos - 9; --i) {
        if(V[i] >= V[i + 1]) {
            return 0;
        }
    }

    for(int i = pos + 1; i <= pos + 9; ++i) {
        if(V[i] >= V[i - 1]) {
            return 0;
        }
    }

    return 1;
}

int main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    #endif // ONLINE_JUDGE

    int N;

    scanf("%d\n", &N);

    for(int i = 1; i <= N; ++i) {
        scanf("%d", &V[i]);
    }

    int answer = 0;

    for(int i = 10; i <= N - 9; ++i) {
        answer += check(i);
    }

    cout << answer << '\n';

    return 0;
}