#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;
  l = k * l / n / nl;
  d = d * c / n;
  p = p / n / np;
  int min = 1000000;
  if (l < min) min = l;
  if (p < min) min = p;
  if (d < min) min = d;
  cout << min << endl;
}
