#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ld = long double;
using ulli = unsigned long long int;
int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1};
void solve() {
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  cout << min((k * l) / nl, min((c * d), p / np)) / n;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
}
