#include <iostream>

using namespace std;

int x[100010];

//ifstream cin("data.in");
//ofstream cout("data.out");

bool panic(int pos, int n) {
    bool ok = 1;
    for (int i = pos - 9; i < pos; ++i)
        if (i < 1 || x[i] >= x[i + 1])
            ok = 0;
    for (int i = pos; i < pos + 9; ++i)
        if (i > n || x[i] <= x[i + 1])
            ok = 0;
    return ok;
}

int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> x[i];
    int res = 0;
    for (int i = 1; i <= n; ++i)
        if (panic(i, n))
            ++res;
    cout << res;
    return 0;
}