#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, k, l, c, d, p, nl, np, smllno;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  long int reqdrk, reqslc, reqslt, ttldrk, ttlslc;
  reqdrk = n * nl;
  reqslc = n;
  reqslt = n * np;
  ttldrk = k * l;
  ttlslc = c * d;
  if (ttldrk < reqdrk || ttlslc < reqslc || p < reqslt) {
    cout << "0";
    exit(0);
  }
  if (ttlslc < (ttldrk / nl)) {
    if (ttlslc < (p / np))
      smllno = ttlslc;
    else
      smllno = (p / np);
  } else {
    if ((ttldrk / nl) < (p / np))
      smllno = (ttldrk / nl);
    else
      smllno = (p / np);
  }
  smllno = smllno / n;
  cout << smllno;
  return 0;
}
