#include <bits/stdc++.h>
bool isT = false;
void solv(int curt);
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  if (isT) {
    int t;
    std::cin >> t;
    for (int i = 1; i <= t; i++) {
      solv(i);
    }
    return 0;
  }
  solv(0);
  return 0;
}
void solv(int curt) {
  int n, k, l, c, d, p, nl, np;
  std::cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  std::cout << std::min(k * l / (nl * n), std::min(c * d / n, p / (np * n)))
            << "\n";
}
