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