#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np, x, y, z;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  x = (k * l) / nl;
  y = p / np;
  z = c * d;
  if (x <= y && x <= z) {
    cout << x / n;
  } else if (y <= z && y <= x) {
    cout << y / n;
  } else {
    cout << z / n;
  }
}
