#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int totalVolumeInMilli = k * l;
  int totalSlices = c * d;
  cout << min({totalVolumeInMilli / nl, totalSlices, p / np}) / n << "\n";
  return 0;
}
