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