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