#include <bits/stdc++.h>
using namespace std;
long long int arr[105];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, x, y, t, l, m, k = 0, r = 0, a, b, c, d, p = 0, q = 0, i, j,
                                  ans = 0, ans1 = 0;
  string s1, s;
  char ch;
  long long int nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  cout << min(k * l / nl, min(c * d, p / np)) / n << "\n";
  return 0;
}
