#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np, temp = 100000, i;
  int a[3];
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  a[0] = (k * l) / nl;
  a[1] = c * d;
  a[2] = p / np;
  for (i = 0; i < 3; i++) {
    if (a[i] < temp) {
      temp = a[i];
    }
  }
  cout << temp / n << endl;
  return 0;
}
