#include #include #include #include #define rep( i, n, m ) for(ll i = ( n ); i < ( m ); i++) using ll = long long int; int give_water( int* array, int begin, int end ); int main( void ){ int n; if (!scanf( "%d", &n )) return 0; int count = 0; rep( i, 0, n ){ static int pre_input = 0; int input; if (!scanf( "%d", &input )) return 0; if (input < pre_input) count++; pre_input = input; } printf( "%d\n", count); return 0; }