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