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