#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np, num;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int drink = k * l;
  int limes = c * d;
  int toasts = drink / nl;
  int salt = p / np;
  vector<int> arr = {toasts, limes, salt};
  sort(arr.begin(), arr.end());
  num = arr[0];
  cout << int(num / n);
}
