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