#include <bits/stdc++.h>
using namespace std;
int n, k, l, c, d, p, nl, np;
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = (s << 1) + (s << 3) + ch - '0';
    ch = getchar();
  }
  return s * w;
}
int main() {
  n = read(), k = read(), l = read(), c = read(), d = read(), p = read(),
  nl = read(), np = read();
  printf("%d\n", min(k * l / nl, min(c * d, p / np)) / n);
  return 0;
}
