object Main extends App {
  val src: List[List[Int]] = io.Source.stdin.getLines.map(_.split(",").map(_.toInt).toList).toList

  def whereToMeet(li: List[Int]): Int = {
    val numOfStations = 10
    val (spans, ratio) = li.splitAt(10)

    val distanceFromHead = spans.sum * ((ratio(0): Double) / (ratio(0) + ratio(1)))

    def findThePoint(spans: List[Int], distanceFromHead: Double): List[Int] = {
      if (distanceFromHead <= 0) spans
      else findThePoint(spans.tail, distanceFromHead - spans.head)
    }

    numOfStations - findThePoint(spans, distanceFromHead).length
  }

  for (list <- src) println(whereToMeet(list))
}