#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np, a, b;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  a = (k * l) / nl;
  b = p / np;
  l = d * c;
  int q = (a > l) ? (l > b ? b / n : l / n) : (a > b ? b / n : a / n);
  cout << q;
}
