#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np, ans = 0;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int ml = k * l;
  int lime = c * d;
  while ((ml >= n * nl) && (lime >= n) && (p >= n * np)) {
    ml = ml - n * nl;
    lime = lime - n;
    p = p - n * np;
    ans++;
  }
  cout << ans;
}
