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