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