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