TT1103 is delivering a large quantity of identical-sized microwaves to MC (Microwave Central). To make things faster, he has borrowed a truck from his magic grandpa.
A little known fact is that when microwaves enter Microwave Central, they must all be aligned in the same way. Thus, TT1103 must pack all of the microwaves into the truck in the same orientation. In particular, each side of the microwave must be parallel to one side to the truck.
TT1103 has ~N~ microwaves to pack, and each microwave is a rectangular prism with dimensions ~X~ by ~Y~ by ~Z~. The truck he borrowed is a rectangular prism with dimensions ~A~ by ~B~ by ~C~. Please help TT1103 figure out how many trips he will have to make so he can inform his magic grandpa!
The first line of input will contain a single integer: ~N~ ~(1 \leq N \leq 10^9)~
The next line of input will contain three space-separated integers, ~X~, ~Y~, and ~Z~ ~(1 \leq X, Y, Z \leq 10^5)~, the dimensions of each microwave.
The next line of input will contain three space-separated integers, ~A~, ~B~, and ~C~ ~(1 \leq A, B, C \leq 10^9)~, the dimensions of the truck.
Output a single integer: the minimal number of trips TT1103 will have to make if he packs the microwaves optimally. If TT1103 cannot fit a single microwave into the truck, print
Note: It is recommended to use 64-bit integers (
long long in C++,
int64 in Pascal,
long in Java) when computing the answer. It is guaranteed that the maximum number of microwaves that can fit in a truck will fit in a 64-bit signed integer.
Sample Input 1
1500 3 1 2 20 30 10
Sample Output 1
Explanation for Sample Output 1
If TT1103 optimally arranges microwaves, he can fit 1000 microwaves inside of the truck at once. Thus, he can deliver all of the microwaves in 2 trips.
Sample Input 2
1500 30 10 20 5 5 5
Sample Output 2
Explanation for Sample Output 2
TT1103 cannot fit any microwaves into the truck, and thus he has been