#include <bits/stdc++.h>
using namespace std;
int n, k, l, c, d, p, nl, np, q, w, x, y, z, t, ans;
int main() {
  scanf("%d%d%d%d%d%d%d%d", &n, &k, &l, &c, &d, &p, &nl, &np);
  q = k * l;
  w = c * d;
  x = q / nl;
  y = w;
  z = p / np;
  if (x < y)
    t = x;
  else
    t = y;
  if (t > z) t = z;
  ans = t / n;
  printf("%d", ans);
  return 0;
}
