#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, nd, np, min = 0, totl, totp, res;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  nd = d * c;
  totl = (k * l) / nl;
  totp = p / np;
  if (totl <= nd && totl <= totp)
    min = totl;
  else if (nd <= totl && nd <= totp)
    min = nd;
  else if (totp <= totl && totp <= nd)
    min = totp;
  res = min / n;
  cout << res << endl;
  return 0;
}
