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