object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt
  val seq = Seq.fill(n)(sc.nextInt)
  
  def loop(seq: Seq[Int], count: Int = 1): Int = {
    val head = seq.head
    if (head == 1) count
    else loop(seq.filter(_ < head), count + 1)
  }
  
  println(loop(seq))
}