#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
	int n, a[100000], ans = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int j = 1; j < n; j++) {
		if (a[j] > a[j - 1]) {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}
