#include <bits/stdc++.h>
using namespace std;
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);
  cout << min(k * l / nl, min(c * d, p / np)) / n << endl;
  ;
  return 0;
}
