#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k, l, d, e, p, nl, np, a, b, c;
  scanf("%d%d%d%d%d%d%d%d", &n, &k, &l, &d, &e, &p, &nl, &np);
  a = k * l / nl;
  b = d * e;
  c = p / np;
  printf("%d\n", min(a, min(b, c)) / n);
  return 0;
}
