object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val x :: xs = List.fill(sc.nextInt())(sc.nextInt())
  val (_, count) = xs.foldLeft(x -> 1) {
    case ((l, count), r) => r.max(l) -> (count + (if (l <= r) 1 else 0))
  }
  println(count)
}
