#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  long long n_drink = k * l;
  long long t_drink = n_drink / nl;
  long long t_lime = c * d;
  long long t_salt = p / np;
  long long ans = min(t_drink, min(t_lime, t_salt));
  cout << ans / n;
}
