#include <bits/stdc++.h>
using namespace std;
const int inf = -1 * 1e9;
const int nmax = 1e6;
int n, k, l, c, d, p, nl, np;
int main() {
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int c1 = k * l / nl;
  int c2 = c * d;
  int c3 = p / np;
  printf("%d ", min(min(c1, c2), c3) / n);
  ;
  return 0;
}
