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