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