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