io = STDIN
N=io.gets.to_i
a=N.times.map{io.gets.to_i}
ar= a.chunk_while{|i,j|i<j}.to_a
def calc(ar)
  return ar.size if ar.size<=2
  a0=ar[0]
  a1=ar[1]
  a2=ar[2]
  aelse=ar[3..-1]
  if a0[-1]<a2[0]
    if aelse==[]
      calc([a1,[a0,a2].flatten])
    else
      calc([a1,[a0,a2].flatten,aelse])
    end
  else
    2+calc(ar[2..-1])
  end
end
p calc(ar)
