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