object Main {
  def main(args: Array[String]): Unit = {
    import scala.io.StdIn.readLine
    val datX = readLine.split(" ").map(_.toInt)

    (0 to 4) foreach {i =>
      if (datX(i) == 0) println(i + 1)
    }
  }
}
