Juice#11378

Juice

1 second
128 megabytes
Very easy

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 a catch — 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?

Input

The first line contains three integers , and . The second line contains three integers , and . All numbers are non-negative integers not greater than 10^9.

Output

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

Examples

Example 1

Loading
Loading