#include <iostream>

using namespace std;

int a[1000005];

int main()
{
    ios_base :: sync_with_stdio(false);

    int n = 0;
    cin >> n;

    for (int i =1 ; i <= n; ++ i)
        cin >> a[i];

    int ans = 0;

    for (int i = 10; i + 9 <= n; ++ i) {
        bool ok = true;
        for (int j = 0; j < 9; ++ j)
            if (a[i - j - 1] >= a[i - j]) {
                ok = false;
            }
            else if (a[i + j] <= a[i + j + 1])
                ok = false;

        if (ok)
            ++ ans;
    }

    cout << ans << endl;

    return 0;
}