#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <utility>
#include <numeric>
#include <set>
#include <map>
#include <tuple>
#include <string>

int main() {
  size_t n;
  scanf("%zu", &n);

  std::vector<int> a(n);
  for (auto& ai: a) scanf("%d", &ai);

  int res = 0;
  for (size_t i = 1; i < n; ++i)
    if (a[i-1] < a[i]) ++res;

  printf("%d\n", res);
}

