#include //#define fin cin //#define fout cout #define F first #define S second using namespace std; typedef long long ll; int n , i , j , ans; int a[100010]; int main() { #ifndef ONLINE_JUDGE freopen("input.in","r",stdin); freopen("output.out","w",stdout); #endif // ONLINE_JUDGE /* #ifndef ONLINE_JUDGE ifstream fin("input.in"); ofstream fout("output.out"); #endif // ONLINE_JUDGE */ scanf("%d", &n); for (i = 1; i <= n; ++i) scanf("%d", &a[i]); for (i = 10; i <= n - 9; ++i) { bool ok = 1; for (j = i - 9; j < i; ++j) if (a[j] < a[j+1]); else ok = 0; for (j = i; j < i + 9; ++j) if (a[j] > a[j+1]); else ok = 0; if (ok) ans++; } printf("%d\n", ans); return 0; }