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