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