#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int req1, req2, req3;
  req1 = (k * l) / nl;
  req2 = (c * d);
  req3 = p / np;
  int min = req1;
  if (req2 < req1) {
    if (req3 < req2) {
      min = req3;
    } else
      min = req2;
  } else if (req3 < req1) {
    min = req3;
  }
  cout << min / n;
  return 0;
}
