#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int mini = min(min(k * l / nl, c * d), p / np);
  cout << mini / n << endl;
  return 0;
}
