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