#include<bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long
#define ull unsigned long long
#define se second
#define fi first
#define be begin()
#define en end()
#define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
int main()
{
Faster;
int n; cin >> n;
int a[n];
int ans = 0;
for(auto &x : a) cin >> x;
for(int i = 0; i < n - 3; i++)
{
int ok = 1;
for(int j = i + 1; j < i + 4; j++)
{
if(a[j] <= a[j-1])
{
ok = 0;
break;
}
}
if(ok == 1) ans++;
}
cout << ans;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgYmUgYmVnaW4oKQojZGVmaW5lIGVuIGVuZCgpCiNkZWZpbmUgRmFzdGVyIGNpbi50aWUoMCk7IGNvdXQudGllKDApOyBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwoKaW50IG1haW4oKQp7CiAgICBGYXN0ZXI7CiAgICBpbnQgbjsgY2luID4+IG47CiAgICBpbnQgYVtuXTsKICAgIGludCBhbnMgPSAwOwogICAgZm9yKGF1dG8gJnggOiBhKSBjaW4gPj4geDsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBuIC0gMzsgaSsrKQogICAgewogICAgICAgIGludCBvayA9IDE7CiAgICAgICAgZm9yKGludCBqID0gaSArIDE7IGogPCBpICsgNDsgaisrKQogICAgICAgIHsKICAgICAgICAgICAgaWYoYVtqXSA8PSBhW2otMV0pCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIG9rID0gMDsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmKG9rID09IDEpIGFucysrOwogICAgfQogICAgY291dCA8PCBhbnM7CiAgICByZXR1cm4gMDsKfQo=