/*
*/

//#pragma comment(linker, "/STACK:16777216")
#define _CRT_SECURE_NO_WARNINGS

#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>
#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk
#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd

#define eps 1e-9
#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 256

using namespace std;

const int N = 120000;

int n, ar[N];
int ans;

int main(){
	//freopen("fabro.in","r",stdin);
	//freopen("fabro.out","w",stdout);
	//freopen("F:/in.txt", "r", stdin);
	//freopen("F:/output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);
	
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> ar[i];
	}

	for (int center = 9; center < n - 9; center++)
	{
		bool ok = 1;
		for (int i = center - 9; i < center; i++)
		{
			if (ar[i] >= ar[i + 1])
				ok = 0;
		}
		for (int i = center; i < center + 9; i++)
		{
			if (ar[i] <= ar[i + 1])
				ok = 0;
		}
		if (ok)
			++ans;
	}
	cout << ans << endl;

	cin.get(); cin.get();
	return 0;
}