#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	int ans = 0;
	int N,tmp,pre;

	scanf("%d",&N);
	scanf("%d",&pre);

	for(int i = 1; i < N; i++){

		scanf("%d",&tmp);
		if(pre < tmp){

			ans++;
		}
		pre = tmp;
	}

	printf("%d\n",ans);

	return 0;
}

