#include <bits/stdc++.h>
const int mxN = 1e9;
const int MOD = 1e9 + 7;
using namespace std;
void solve() {
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int limes = c * d;
  int drinks = (l * k) / nl;
  int salt = p / np;
  cout << min(limes, min(drinks, salt)) / n;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  solve();
}
