In building C of ADA University, one prepares a very tasty and healthy multivitamin juice. One dose of juice requires apples, pears, and oranges. However, there is bad luck — you must bring the fruits for juice with you!
Huseyn likes multivitamin juice very much. He currently has apples, pears, and oranges. What is the maximum number of juice doses he can order?
The first line contains three integers , and . The second line contains three integers , and . All numbers are non-negative integers not greater than .
Print the largest number of juice doses that Huseyn can order.