eolymp
Competitions

БГУ Личное Первенство

Juice

Time limit 1 second
Memory limit 128 MiB

In building C of ADA University, one prepares a very tasty and healthy multivitamin juice. One dose of juice requires a apples, b pears, and c oranges. However, there is bad luck — you must bring the fruits for juice with you!

Huseyn likes multivitamin juice very much. He currently has x apples, y pears, and z oranges. What is the maximum number of juice doses he can order?

Input data

The first line contains three integers a, b, and c. The second line contains three integers x, y, and z. All numbers are non-negative integers not greater than 10^9.

Output data

Print the largest number of juice doses that Huseyn can order.

Examples

Input example #1
1 2 6
3 8 15
Output example #1
2
Author Mykhailo Medvediev