This winter is so cold in Nvodsk! A group of *n* friends decided to buy *k* bottles of a soft drink called "Take-It-Light" to warm up a bit. Each bottle has *l* milliliters of the drink. Also they bought *c* limes and cut each of them into *d* slices. After that they found *p* grams of salt.

To make a toast, each friend needs *nl* milliliters of the drink, a slice of lime and *np* grams of salt. The friends want to make as many toasts as they can, provided they all drink the same amount. How many toasts can each friend make?
The first and only line contains positive integers *n*, *k*, *l*, *c*, *d*, *p*, *nl*, *np*, not exceeding 1000 and no less than 1. The numbers are separated by exactly one space.
3 4 5 10 8 100 3 1
2
5 100 10 1 19 90 4 3
3
10 1000 1000 25 23 1 50 1
0
1 7 4 5 5 8 3 2
4
2 3 3 5 5 10 1 3
1
2 6 4 5 6 5 1 3
0
1 7 3 5 3 6 2 1
6
2 4 5 4 5 7 3 2
1
2 3 6 5 7 8 2 1
4
1 4 5 5 3 10 3 1
6
1 4 6 7 3 5 1 3
1
1 6 5 5 5 8 3 1
8
1 7 5 3 3 9 2 1
9
3 5 3 7 6 10 3 1
1
3 6 3 5 3 6 3 1
2
1 7 5 5 5 5 2 2
2
2 5 3 5 6 9 2 1
3
3 4 3 5 3 6 2 1
2
1 5 5 4 7 6 3 1
6
2 3 7 6 5 9 3 1
3
2 6 5 3 3 8 1 1
4
2 4 7 3 4 10 2 1
5
1 1000 1000 1000 1000 1000 1 1
1000
17 1000 1000 1000 1000 1000 3 7
8
115 1000 1000 1000 1000 1000 17 15
0
1 587 981 1 2 1 1 1
1
1 1 2 1 2 2 1 1
2
a,b,c,d,e,f,g,h=map(int,input().split())
q=b*c
w=q//h
i=d*e
n=f//h
print(min(w,i,n)//a)