#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 kl = k * l;
  int cd = c * d;
  int nod1 = kl / (nl * n);
  int nod2 = cd / n;
  int nod3 = p / (np * n);
  cout << min(nod1, min(nod2, nod3));
}
