#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np, a, b, f, mina;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  a = (l * k) / nl;
  b = (c * d);
  f = p / np;
  if (a < b)
    mina = a;
  else
    mina = b;
  if (mina > f) mina = f;
  cout << (mina / n);
  return 0;
}
