#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int tl = k * l;
  int ts = c * d;
  cout << (min(tl / nl, min(p / np, ts))) / n << endl;
}
