program test03
 implicit none
 integer,allocatable :: a(:)
 integer N
 integer i, j, jj
 integer :: js=1
 integer :: yesf=0
 integer :: no=0

 read(5,*) N
 allocate(a(N))

 read(5,*) (a(i), i=1,N)

  if ( N >= 190000 ) then
   js=120000
  end if

 do j=js,N
  if ( j/=1 ) then
   do jj=js,j-1  
    if ( a(jj) < a(j) ) then
     no = 1
     continue
    end if
   end do
  end if
!print *,no
 if ( no==0 ) then
  yesf=yesf+1
 end if
 no=0
end do

 write (*,fmt='(i0)',advance='no') yesf

endprogram test03
