program main
  implicit none

  integer                               :: n, i, color
  integer, allocatable, dimension ( : ) :: A
  color = 0
  
  read *, n

  allocate ( A ( 1:n ) )

  read *, A ( 1 )
  do i = 2, n
     read *, A ( i )
     
     if ( A ( i - 1 ) < A ( i ) ) then
        color = color + 1
     end if
     
  end do

  print *, color

end program main
