line = $stdin
lines = line.readlines
line.close

lines.each do |l|
	arr = l.split(",")
	arr_int =  arr[0..9].map{|s| s.to_i}
	dist_sum = arr_int.reduce(:+)
	v1, v2 = arr[10].to_i, arr[11].to_i
	meet_t = dist_sum.to_f / (v1.to_f + v2.to_f)
	meet_l = meet_t * v1
	
	ans = 0
	for i in 0..9 do
		ans += arr_int[i]
		if ans >= meet_l then
			p ans
			break
		end
	end
end