#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np, res1, res2, res3;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  res1 = k * l / nl;
  res2 = p / np;
  res3 = c * d;
  cout << min(res1, min(res2, res3)) / n << endl;
  return 0;
}
