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