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