#include <bits/stdc++.h>
int main() {
  int n, k, l, c, d, p, nl, np, lit, sl, cl;
  scanf("%d %d %d %d %d %d %d %d", &n, &k, &l, &c, &d, &p, &nl, &np);
  lit = (l * k) / nl;
  sl = c * d;
  cl = p / np;
  if (lit <= sl && lit <= cl) {
    printf("%d", lit / n);
    return 0;
  }
  if (sl <= lit && sl <= cl) {
    printf("%d", sl / n);
    return 0;
  }
  if (cl <= sl && cl <= lit) {
    printf("%d", cl / n);
    return 0;
  }
}
