#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 ga = (k * l) / (nl * n);
  int so = p / (np * n);
  int li = (c * d) / n;
  cout << min(min(ga, so), li) << endl;
}
