#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 55;
const int inf = 1e9 + 77;
const int MOD = 1e9 + 7;
const double PI = 3.14159265359;
const double eps = 1e-7;
const int MAXN = (int)1e6 + (int)1e5;
int a[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  cout << min(min(k * l / nl, c * d), p / np) / n;
  return 0;
}
