#include <cstdio>
using namespace std;
int main(void){
    int n, prev, now, sum = 0;
    scanf("%d", &n);
    scanf("%d", &prev);
    for (int i = 1; i < n; i++) {
        scanf("%d", &now);
        if (now > prev) sum++;
        prev = now;
    }
    printf("%d\n", sum);
    return 0;
}

