object Main {
  def main(args: Array[String]): Unit = {
    val nums = scala.io.StdIn.readLine.split( " " ).map{ _.toInt }
    var count = 0
    nums.foreach{ i =>
      count += 1
      if ( i == 0 ) println( count )
    }
  }
}