#include "iostream"

using namespace std;

int main() {
  int n;
  cin >> n;
  int pre;
  cin >> pre;
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    int a;
    cin >> a;
    ans += pre < a;
    pre = a;
  }
  cout << ans << endl;
  return 0;
}
