#include <bits/stdc++.h>
using namespace std;
int n, m, k, j, i, res;
pair<int, int> x[200000], y[200000];
int main() {
  int l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  m = k * l;
  m /= nl;
  m /= n;
  p /= np;
  p /= n;
  c *= d;
  c /= n;
  res = min(min(c, p), m);
  cout << res;
  return 0;
}
