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