#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 toasts = 0;
  while (toasts >= 0) {
    if ((k * l >= n * nl * toasts) && (c * d >= n * toasts) &&
        (p >= n * np * toasts)) {
      toasts += 1;
    } else
      break;
  }
  cout << toasts - 1;
  return 0;
}
