#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 drinks = k * l;
  int limes = c * d;
  cout << min({drinks / nl, limes, p / np}) / n;
  return 0;
}
