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
# # count=int(input())
# # while count>0:
# #     ab=list(map(int,input().split()))
# #     # a.sort()
# #     # print(a)
# #     b=list(map(int,input().split()))
# #     ce=list(map(int,input().split()))
# #     d=list(map(int,input().split()))
# #     # d=asd+b+c
# #     # d.sort()
# #     # print(d)
# #     c,e,f,g=0,0,0,0
# #     l=[]
# #     while c!=ab[1]:
# #         temp1,temp2,temp3=(99999,8888),(99999,8888),(99999,8888)
# #         if e<len(d):temp1=c^b[e],1
# #         if f<len(d):temp2=c^ce[f],2
# #         if g<len(d):temp3=c^d[g],3
# #         if temp1[0]==ab[1] or temp2[0]==ab[1] or temp3[0]==ab[1]:
# #             c=ab[1]
# #             break
# #         if e>len(d) or f>len(d) or g>len(d):
# #             break
# #         # print(temp1+temp2+temp3)
# #         k=min((temp1[0]-ab[1]),(temp2[0]-ab[1]),(temp3[0]-ab[1]))
# #         # print((temp1[0]-ab[1]),(temp2[0]-ab[1]),(temp3[0]-ab[1]))
# #         if k==(temp1[0]-c):
# #             # e+=1
# #             if c>temp1[0]:
# #                 a=min(temp2[0],temp3[0])
# #                 if a==temp2[0]:
# #                     if c>a:
# #                         a=temp3[0]
# #                         if c>a:
# #                             break
# #                         else:
# #                             c=a
# #                             g+=1
# #                     else:
# #                         c=a
# #                         f+=1
# #                 elif a==temp3[0]:
# #                     if c>a:
# #                         a=temp2[0]
# #                         if c>a:
# #                             break
# #                         else:
# #                             c=a
# #                             f+=1
# #             else:
# #                 c=temp1[0]
# #                 e+=1
# #         elif k==(temp2[0]-c):
# #             f+=1
# #             if c>temp2[0]:
# #                 a=min(temp1[0],temp3[0])
# #                 if a==temp1[0]:
# #                     if c>a:
# #                         a=temp3[0]
# #                         if c>a:
# #                             break
# #                         else:
# #                             c=a
# #                     else:
# #                         c=a
# #                 elif a==temp3[0]:
# #                     if c>a:
# #                         a=temp1[0]
# #                         if c>a:
# #                             break
# #                         else:
# #                             c=a
# #             else:
# #                 c=temp2[0]
# #         else:
# #             g+=1
# #             if c>temp3[0]:
# #                 a=min(temp2[0],temp1[0])
# #                 if a==temp2[0]:
# #                     if c>a:
# #                         a=temp1[0]
# #                         if c>a:
# #                             break
# #                         else:
# #                             c=a
# #                     else:
# #                         c=a
# #                 elif a==temp1[0]:
# #                     if c>a:
# #                         a=temp2[0]
# #                         if c>a:
# #                             break
# #                         else:
# #                             c=a
# #             else:
# #                 c=temp3[0]
# #         # l.append(c)
# #     # print(l)
# #     print("Yes") if c==ab[1] else print("No")
# #     count-=1

# # import math


# # def solve():
# #     ab=list(map(int,input().split()))
# #     l,m=list(map(int,input().split()))
# #     ji=[[l,m]]
# #     e=0
# #     for i in range(ab[0]-1):
# #         k,q=list(map(int,input().split()))
# #         o,p=ji[0]
# #         e+=math.sqrt((k-o)**2+(q-p)**2)
# #         ji=[]
# #         ji.append([k,q])
# #     print(e*ab[1]/50)

# # solve()


# # def soln():
# #     count=int(input())
# #     while count>0:
# #         a=int(input())
# #         ab=list(map(int,input().split()))
# #         # ba=[x for x in ab if x>=0]
# #         # print(min(ba))
# #         c={x:ab.count(x) for x in ab }
# #         c=sorted(c.items(),key=lambda x:x[1],reverse=True)
# #         print(c)
# #         temp=c[0][1]
# #         ans=c[0][0]
# #         for i in range(len(c)):
# #             if c[i][1]==temp:
# #                 if c[i][0]<ans:
# #                     ans=c[i][0]
# #             else:
# #                 break
# #         print(ans)

# #         count-=1
# # soln()

# #1844A


# # a=input()
# # b=input()
# # c=''
# # for i in range(len(a)):
# #     if a[i]!=b[i]:
# #         c+='1'
# #     else:
# #         c+='0'
# # print(c)


# #1771C
# # import math


# # def is_prime(n):
# #     if n <= 1:
# #         return False
# #     for i in range(2, int(n ** 0.5) + 1):
# #         if n % i == 0:
# #             return False
# #     return True

# # a=int(input())
# # for i in range(a):
# #     b=int(input())
# #     ab=list(map(int,input().split()))

# #     fg=0
# #     for i in range(b):
# #         if fg:break
# #         for j in range(i,b):
# #             if i!=j:
# #                 # if int(str(b[i])[-1])%2==0
# #                 if math.gcd(ab[i],ab[j])>1:
# #                     print("YES")
# #                     fg=1
# #                     break
# #     else:
# #         print("NO")

# # import math
# # def is_successful_pair(a, b):
# #     if math.gcd(a,b)>1:
# #         return True
# #     return False

# # def solve(t):
# #     for _ in range(t):
# #         n = int(input())
# #         a = list(map(int, input().split()))
# #         if any(is_successful_pair(a[i], a[j]) for i in range(n) for j in range(i + 1, n)):
# #             print("YES")
# #         else:
# #             print("NO")

# # if __name__ == "__main__":
# #     t = int(input())
# #     solve(t)
# def sol(c,n):
#     k=1
#     for i in c:
#         k*=i
#     # print(k)
#     if k%(2**n)==0:return 1
#     else: return 0

# # a=int(input())
# # for i in range(a):
# #     b=int(input())
# #     n=0
# #     k=1
# #     c=list(map(int,input().split()))
# #     c.sort()
# #     for i in c:
# #         k*=i
# #     cnt=1
# #     fg=0
# #     for i in range(len(c)):
# #         while cnt!=len(c)-1:
# #             if k%(2**a):
# #                 print(n)
# #                 fg=1
# #                 break
# #             else:
# #                 k*=cnt
# #             cnt+=1
# #         n+=1
# #         if fg:
# #             break
# #     else:
# #         print(-1)

# #1841B


# # a=int(input())
# # for i in range(a):
# #     b=int(input())
# #     ans=''
# #     c=list(map(int,input().split()))
# #     d,e=[],[]
# #     for j in c:
# #         d.append(j)
# #         # e.append(j)
# #         # e.sort()
# #         if sorted(d)==d:
# #             ans+='1'
# #         else:
# #             d.pop()
# #             d.insert(0,j)
# #             if sorted(d)==d:
# #                 ans+='1'
# #                 d.pop(0)
# #                 d.append(j)
            
# #             else:
# #                 d.pop(0)
# #                 ans+='0'
# #         print(d)
# #     print(ans)


# # n = int(input())
# # a = list(map(int, input().split()))

# # min_operations = float('inf')

# # for diff in range(-100, 101):  # Iterate over possible common differences
# #     operation_count = 0
# #     prev = a[0]
# #     for i in range(1, n):
# #         expected = prev + diff  # Calculate expected value based on common difference
# #         operation_count += abs(a[i] - expected)
# #         prev = expected
# #     min_operations = min(min_operations, operation_count)

# # print(min_operations)



# # a=list(input())
# # # print(a.count('a'))
# # # print(len(a))
# # for i in range(len(a)):
# #     try:
# #         if a.count('a')>len(a)/2:
# #             print(len(a))
# #             break
# #         else:
# #             for j in range(len(a)):
# #                 if a[j]!='a':
# #                     a.pop(j)
# #                     break
# #     except:
# #         continue




# # # a=list(map(int,input().split()))
# # # b=list(map(int,input().split()))

# # # b.sort()
# # # c=0
# # # for i in range(a[1]):
# # #     if b[i]<=0:c+=b[i]*(-1)
# # # print(c)
# # # l=[0,1,2,]
# # def minheap(n):
# #     # for i in range(n):
# #     c=0
# #     while n>0:
# #         c+=n
# #         n=n//2
# #     return c
# # a=int(input())
# # for i in range(a):
# #     b=int(input())
# #     print(minheap(b))


# # a=int(input())
# # for i in range(4,a+1):
# #     if a%i==0:
# #         # print("HI")
# #         if len(str(i))==str(i).count('4')+str(i).count('7'):
# #             # print(len(str(i)))
# #             # print(str(a).count('4')+str(a).count('7'))
# #             # print(i)
# #             print("YES")
# #             break
# # else:
# #     print("NO")

# # a=list(map(int,input().split()))
# # b=list(input())
# # fg=1
# # for i in range(a[1]):
# #     fg=1
# #     for j in range(len(b)-1):
# #         # print(j)
# #         if b[j]=='B' and b[j+1]=='G' and fg:
# #             temp=b[j]
# #             b[j]=b[j+1]
# #             b[j+1]=temp
# #             fg=0
# #         else:
# #             fg=1
# # for i in b:
# #     print(i,end='')



# # def power(x, n):
# #     if n == 0:
# #         return 1
# #     if n % 2 == 0:
# #         pow_h = power(x, n // 2)
# #         return pow_h * pow_h
# #     else:
# #         pow_h = power(x, (n - 1) // 2)
# #         return x * pow_h * pow_h


# # print(power(3,1))
# # a=list(map(int,input().split()))
# # b=list(map(int,input().split()))
# # c=int(input())
# # for i in range(c):
# #     vi=1
# #     k=list(map(int,input().split()))
# #     k[0]-=1
# #     k[1]-=1
# #     ho=b[k[0]:k[1]+1]
# #     if k[0]==k[1]:
# #         print(ho[0])
# #     else:
# #         ho.reverse()
# #         for ji in ho:
# #             vi=power(ji,vi)
# #         print(vi%a[1])

# # a=int(input())
# # for i in range(a):
# #     b=int(input())
# #     l=[]
# #     if b==1:
# #         print(1)
# #         print(*[1,3])
# #     else:
# #         print(b-1)
# #         for i in range(1,b):
# #             l.append(3*i)
# #             l.append(3*i+1)
# #     print(*l,end='')
# # c = 0
# # for _ in range(int(input())):
# #     a = int(input())
# #     numbers = list(map(int, input().split()))
# #     max_xor = 0
# #     c += 1
# #     if c == 78:
# #         print(numbers)
# #     for i in numbers:
# #         for j in numbers:
# #             xor = i ^ j
# #             if xor > max_xor:
# #                 max_xor = xor
# #     print(max_xor)

# # def get(a, b, c):
# #     return max(0, (a + b + c) * (a + b - c) * (a + c - b) * (b + c - a))

# # def query(i, j, k):
# #     print(f"? {i} {j} {k}")
# #     res = int(input())
# #     return res

# # n = int(input())
# # a = [0] * (n + 1)

# # if n < 9:
# #     mp = [[[0] * (n + 1) for _ in range(n + 1)] for _ in range(n + 1)]
# #     for i in range(1, n - 1):
# #         for j in range(i + 1, n):
# #             for k in range(j + 1, n + 1):
# #                 mp[i][j][k] = query(i, j, k)

# #     cnt = 0
# #     v = [0] * (n + 1)

# #     def dfs(s):
# #         global cnt
# #         if cnt == 2:
# #             return
# #         if s > n:
# #             cnt += 1
# #             for i in range(1, n + 1):
# #                 a[i] = v[i]
# #             return
# #         for t in range(1, 5):
# #             v[s] = t
# #             if s >= 3:
# #                 for i in range(1, s - 1):
# #                     for j in range(i + 1, s):
# #                         if mp[i][j][s] != get(v[i], v[j], v[s]):
# #                             goto_nx1 = True
# #                             break
# #                     if goto_nx1:
# #                         break
# #                 else:
# #                     goto_nx1 = False
# #             if not goto_nx1:
# #                 dfs(s + 1)
# #             goto_nx1 = False

# #     dfs(1)

# #     if cnt == 1:
# #         print("!", end=" ")
# #         for i in range(1, n + 1):
# #             print(a[i], end=" ")
# #     else:
# #         print("! -1")
# # else:
# #     cur, p1, p2 = 0, 0, 0
# #     mp = {}
# #     for i in range(1, 5):
# #         mp[get(i, i, i)] = i

# #     for i in range(1, 8):
# #         for j in range(i + 1, 9):
# #             for k in range(j + 1, 10):
# #                 t = query(i, j, k)
# #                 if mp.get(t):
# #                     a[i] = a[j] = a[k] = cur = mp[t]
# #                     p1, p2 = i, j
# #                     break
# #             if cur:
# #                 break

# #     if cur == 1:
# #         for i in range(2, 5):
# #             mp[get(1, i, i)] = i
# #         v = []
# #         for i in range(1, n + 1):
# #             if not a[i]:
# #                 t = query(p1, p2, i)
# #                 if t:
# #                     a[i] = 1
# #                 else:
# #                     v.append(i)
# #                     if len(v) >= 4:
# #                         break
# #         if len(v) == 1:
# #             print("! -1")
# #             exit(0)
# #         if len(v) >= 2:
# #             for i in range(len(v) - 1):
# #                 for j in range(i + 1, len(v)):
# #                     t = query(p1, v[i], v[j])
# #                     if mp.get(t):
# #                         a[v[i]] = a[v[j]] = cur = mp[t]
# #                         p1, p2 = v[i], v[j]
# #                         break
# #                 if cur:
# #                     break
# #             if cur == 1:
# #                 print("! -1")
# #                 exit(0)
# #         if cur != 1:
# #             for i in range(1, 5):
# #                 mp[get(i, cur, cur)] = i
# #             for i in range(1, n + 1):
# #                 if not a[i]:
# #                     a[i] = mp[query(p1, p2, i)]
# #     print("!", end=" ")
# #     for i in range(1, n + 1):
# #         print(a[i], end=" ")


# # a=int(input())
# # for _ in range(a):
# #     ab=list(map(int,input().split()))
# #     bb=list(map(int,input().split()))
# #     l=[]
# #     for i in range(ab[2]):
# #         l.append(list(map(int,input().split())))
# #     for i in l:
# #         # print(i)
# #         # print(abs(ab[1]))
# #         if ((abs(bb[0]-i[0])-abs(bb[1]-i[1])))%2==0:
# #             print("NO")
# #             break
# #     else:
# #         print("Yes")

# # a=int(input())
# # for _ in range(a):
# #     ab=list(map(int,input().split()))
# #     # print(ab[1],ab[2])
# #     if ab[1]>=1 and ab[2]!=1:
# #         print("YES")
# #         print(ab[0])
# #         print('1 '*ab[0])
# #     else:
# #         if ab[0]%2==0 and ab[1]>=2 and ab[2]!=2:
# #             print("YES")
# #             print(ab[0]//2)
# #             print('2 '*(int(ab[0]//2)))
# #         elif ab[1]>=2 and ab[0]%2!=0 and ab[2]!=2 and ab[2]!=1:
# #             print("YES")
# #             print((ab[0]//2)+1)
# #             print('2 '*(int((ab[0]-1)//2))+' 1')
# #         else:
# #             print("NO")



# # a=list(input())
# # # print(a)
# # gf=0
# # cnt=0
# # for i in range(len(a)):
# #     if len(a)==1:
# #         break
# #     if str(9-int(a[i]))!='0':
# #         gf=1
# #     if a[i]>='5' and (gf or cnt>=1):
# #         a[i]=str(9-int(a[i]))
# #     cnt+=1
# # fg=0
# # # print(a)
# # for i in a:
# #     if fg:print(i,end='')
# #     else:
# #         if i!='0':
# #             print(i,end='')
# #             fg=1
# # if a.count('0')==len(a):
# #     print(0)

# # l=[]
# # for i in range(3):

# # a=int(input())
# # b=list(input())
# # ans=[x for x in b]
# # fg=1
# # if a%2!=0:
# #     ans[a//2]=b[0]
# #     c=a//2-1
# #     d=a//2+1
# # else:
# #     ans[a//2-1]=b[0]
# #     c=a//2-2
# #     d=a//2
# # for i in b[1::]:
# #     # if a==2:
# #     #     ans=[x for x in b]
# #     #     break
# #     if fg:
# #         ans[c]=i
# #         c-=1
# #         fg=0
# #     else:
# #         ans[d]=i
# #         d+=1
# #         fg=1
# # for i in ans:
# #     print(i,end='')


# # a=list(map(int,input().split()))
# # b=c=0
# # fg=0
# # for i in range(a[2]):
# #     if fg:
# #         break
# #     for j in range(a[2]):
# #         if a[0]*i+a[1]*j==a[2]:
# #             print("Yes")
# #             fg=1
# #             break
# # else:
# #     print("No")


# # a=input()
# # b='CODEFORCES'
# # j=0
# # fg=0
# # KP=0
# # for i in a:
# #     if i==b[j]:
# #         j+=1
# #         if fg!=1:
# #             fg=1
# #             KP=0
# #         elif KP:
# #             break
# #     else:
# #         KP=1
# # print("YES") if j==len(b) else print("NO")



# # a=input().split()
# # # cnt=0
# # ans=a[0][0]
# # for i in a[0][1::]:
# #     if i<a[1][0]:
# #         ans+=i
# # print(ans+a[1][0])

# # a=list(input())
# # fg,gf=0,0
# # for i in range(len(a)-1):
# #     if a[i]=='A':
# #         if a[i+1]=='B':
# #             fg=1
# #             a[i+1]='F'
# #             a[i]='G'
# #             break
# # if fg:
# #     for i in range(len(a)-1):
# #         if a[i]=='B':
# #             if a[i+1]=='A':
# #                 gf=1
# #                 a[i+1]='F'
# #                 a[i]='G'
# #                 break
# # if fg and gf:
# #     print("YES")
# # else:
# #     print("NO")



# # a,b=list(map(int,input().split()))
# # c=0
# # for i in range(max(a,b)*2):
# #     for j in range(max(a,b)*2):
# #         if i**2+j==a and i+j**2==b:
# #             c+=1
# # print(c)



# # def mod_inverse(num, mod):
# #     return pow(num, mod - 2, mod)

# # def factspl(n, mod):
# #     tmp = 1
# #     for i in range(1, n + 1):
# #         tmp *= i
# #         tmp %= mod
# #     return tmp

# # a = int(input())
# # while a > 0:
# #     b = int(input())
# #     ans = factspl(2 * b, 10**9 + 7)
# #     ans = (ans * mod_inverse(2, 10**9 + 7)) % (10**9 + 7)
# #     print(ans)
# #     a -= 1


# # b=list(map(int,input().split()))
# # a=abs(b[0]-b[1])
# # c=abs(b[1]-b[2])
# # d=abs(b[0]-b[2])

# # l=[a,c,d]
# # l.sort()
# # print(l[0]+l[1])


# # n,a,b,c=list(map(int,input().split()))
# # l=[a,b,c]
# # l.sort()
# # ans=0
# # cnt=0
# # while cnt<=2 and n-l[cnt]>=0:
# #     # print(l)
# #     # print(cnt)
# #     n-=l[cnt]
# #     cnt+=1
# # print(cnt)

# # a=int(input())
# # b=list(map(int,input().split()))

# # fg=0
# # ans=0
# # for i in b:
# #     if fg==0 and i==-1:
# #         ans+=1
# #     elif i==-1 and fg!=0:
# #         fg-=1
# #     if i!=-1:
# #         fg+=i
# # print(ans)


# # def fact(n):
# #     if n==1 or n==0:
# #         return 1
# #     else:
# #         return n*fact(n-1)

# # print(fact(5))


# # a=int(input())
# # b=list(map(int,input().split()))
# # b.sort()
# # c=0
# # for i in range(len(b)):
# #     if b[i]==b[0]:
# #         c+=1
# # b.reverse()
# # for i in range(len(b)):
# #     if b[i]==b[-1]:
# #         c+=1
# # print(a-c)


# # def count_simple_cycles(n, edges):
# #     graph = {i: [] for i in range(1, n+1)}
# #     for a, b in edges:
# #         graph[a].append(b)
# #         graph[b].append(a)

# #     def dfs(node, path):
# #         count = 0
# #         for neighbor in graph[node]:
# #             if neighbor not in path:
# #                 count += dfs(neighbor, path.union({neighbor}))
# #             elif neighbor == path_start and len(path) == n:
# #                 count += 1
# #         return count

# #     total_cycles = 0
# #     for start_node in range(1, n+1):
# #         path_start = start_node
# #         total_cycles += dfs(start_node, {start_node})

# #     return total_cycles // 2  # Divide by 2 to account for symmetric cycles

# # # Read input
# # n, m = map(int, input().split())
# # edges = [tuple(map(int, input().split())) for _ in range(m)]

# # # Calculate and print the number of simple cycles
# # print(count_simple_cycles(n, edges))


# # a=int(input())
# # b=list(map(int,input().split()))
# # c,d=0,0
# # for i in b:
# #     if i==25:
# #         c+=1
# #     elif i==50:
# #         d+=1
# #         c-=1
# #     elif i==100:
# #         if c>=1 and d>=1:
# #             c-=1
# #             d-=1
# #         elif c>=3:
# #             c-=3
# #         else:
# #             print("NO")
# #             break
# #     if c<0 or d<0:
# #         print("NO")
# #         break
# # else:
# #     print("YES")


# # a=int(input())
# # b=list(map(int,input().split()))
# # c=0
# # for i in range(len(b)-2):
# #     if b[i]==1==b[i+2] and b[i+1]==0:
# #         b[i]=b[i+2]=0
# #         c+=1
# # print(c)


# # # a=int(input())
# # import math

# # fg=0
# # # print(math.gcd(1,56)+math.lcm(1,56))
# # for _ in range(int(input())):
# #     a=int(input())
# #     print('1 '+str(a-1))


# # a=list(map(int,input().split()))
# # b=list(map(int,input().split()))
# # # b.sort()
# # c=a[1]-a[0]

# # l=[max(b)-min(b)]
# # for i in range(c):
# #     k=b[i:i+a[0]]
# #     # print(k)
# #     l.append(max(k)-min(k))
# # print(min(l))

# from collections import defaultdict


# def dfs(u, par, adj, dp, s):
#     s[u] = 1
#     for v in adj[u]:
#         if v == par:
#             continue
#         dfs(v, u, adj, dp, s)
#         s[u] += s[v]
#         dp[u] += dp[v] + s[v]

# def reroot(u, par, adj, dp, s, ans, n):
#     ans[u] = dp[u]
#     for v in adj[u]:
#         if v == par:
#             continue
#         rem, rems = dp[v], s[v]
#         dp[v] = dp[v] + dp[u] - s[v] - dp[v] + s[u] - s[v]
#         s[v] = n
#         reroot(v, u, adj, dp, s, ans, n)
#         dp[v] = rem
#         s[v] = rems

# def solve():
#     MOD = 1000000007

#     n, k = map(int, input().split())
#     adj = defaultdict(list)

#     for i in range(n - 1):
#         u, v = map(int, input().split())
#         u -= 1
#         v -= 1
#         adj[u].append(v)
#         adj[v].append(u)

#     if k == 1:
#         print(1)
#         return

#     if k == 2:
#         dp = [0] * n
#         s = [0] * n
#         ans = [0] * n
#         dfs(0, -1, adj, dp, s)
#         reroot(0, -1, adj, dp, s, ans, n)
#         ansgot = sum(ans)
#         ansgot //= 2
#         ansgot += n * (n - 1) // 2
#         pr = ((ansgot % MOD) * pow((n * (n - 1) // 2) % MOD, MOD - 2, MOD)) % MOD
#         print(pr)
#     elif k == 3:
#         print(1)

# if __name__ == "__main__":
#     t = 1
#     # t = int(input())
#     for _ in range(t):
#         solve()


# for _ in range(int(input())):
#     a=input()
#     l=[x for x in a if x==a[0]]
#     if len(l)==len(a):
#         print(-1)
#     else:
#         print(len(a)-1)


# for _ in range(int(input())):
#     a=list(map(int,input().split()))
#     b=list(map(int,input().split()))
#     c=[]
#     d=[]
#     for i in b:
#         d=[]
#         for j in b:
#             d.append(i-j)
#         c.append(sum(d))
#     print(max(c))

a=list(map(int,input().split()))
b=(a[1]*a[2])//a[-2]
c=a[3]*a[4]
d=a[-3]//a[-1]
print(min(b,c,d)//a[0])