#include int main(void) { int n, a0, a1; int i, count = 0; scanf("%d", &n); scanf("%d", &a0); for(i = 1;i < n;i++){ scanf("%d", &a1); if(a0 > a1)count++; a0 = a1; } printf("%d\n", count); return 0; }