#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;
  int q = (k * l) / nl;
  int w = c * d;
  int e = p / np;
  if (q < w && q < e)
    cout << q / n << endl;
  else if (w < q && w < e)
    cout << w / n << endl;
  else
    cout << e / n << endl;
  return 0;
}
