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