#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np, s1, s, a, b;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  s1 = (k * l) / nl;
  a = c * d;
  b = p / np;
  s = min(s1, a);
  s = min(s, b) / n;
  cout << s << endl;
  return 0;
}
