#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 t, t1 = (k * l) / nl, t2 = p / np, t3 = c * d;
  t = t1 > t2 ? (t3 > t2 ? t2 : t3) : (t3 > t1 ? t1 : t3);
  printf("%d", t / n);
  return 0;
}
