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