#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e, f, g, h;
  int ans;
  cin >> a >> b >> c >> d >> e >> f >> g >> h;
  ans = min(b * c / g, min(d * e, f / h)) / a;
  cout << ans << endl;
}
