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