import System.IO (isEOF)
import Data.Ratio ((%))
import Data.List.Split (splitOn)

main = do
    quit <- isEOF
    if quit then return () else do
        input >>= return . solve >>= output
        main

input :: IO ([Integer],Integer,Integer)
input = do
    line <- getLine
    let
        ns = map read $ splitOn "," line
        [l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2] = ns
    return ([l1,l2,l3,l4,l5,l6,l7,l8,l9,l10],v1,v2)

output :: Integer -> IO ()
output = print

solve :: ([Integer],Integer,Integer) -> Integer
solve (ls,v1,v2) = spanOf (map fromIntegral ls) d1
    where
    d1 = (fromIntegral v1) * t
    t = (sum ls) % (v1 + v2)

    spanOf :: [Rational] -> Rational -> Integer
    spanOf ls d = spanOf' ls d 1
        where
        spanOf' (l:ls) d n
            | d <= l = n
            | otherwise = spanOf' ls (d-l) (n+1)