#include<iostream>
using namespace std;
int a[10000000],b;
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < n - 1; i++) {
		if (a[i + 1] > a[i]) {
			b++;
		}
	}
	cout << b << endl;
}
