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
def toasts(n, k, l, c, d, p, nl, np):
  """
  This function calculates the number of toasts that a group of friends can make.

  Args:
    n: The number of friends.
    k: The number of bottles of soft drink.
    l: The milliliters of soft drink in each bottle.
    c: The number of limes.
    d: The number of slices in each lime.
    p: The grams of salt.
    nl: The milliliters of soft drink needed for each toast.
    np: The grams of salt needed for each toast.

  Returns:
    The number of toasts that each friend can make.
  """

  total_milliliters = k * l
  total_slices = c * d
  total_grams_of_salt = p

  number_of_toasts = min(
      total_milliliters // nl,
      total_slices,
      total_grams_of_salt // np,
  )

  return number_of_toasts // n


if __name__ == "__main__":
  # Get the input from the user.
  n, k, l, c, d, p, nl, np = map(int, input().split())

  # Calculate the number of toasts that each friend can make.
  number_of_toasts_per_friend = toasts(n, k, l, c, d, p, nl, np)

  # Print the result.
  print(number_of_toasts_per_friend)
