#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  long long totlime = c * d;
  long long totdrink = k * l;
  totdrink = totdrink / nl;
  long long totsalt = p / np;
  long long mn = min(totlime, totdrink);
  mn = min(mn, totsalt);
  cout << mn / n << "\n";
}
int main() {
  solve();
  return 0;
}
