#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <queue>
#include <map>
#include <iomanip>
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin >> n;
    int a[n + 5], ans = 0;

    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n - 1; i++) ans += (a[i] < a[i + 1]);
    cout << ans << endl;

}
