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