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