#include <bits/stdc++.h>
using namespace std;
int main() {
  {
    long long int a, b, c = 0, d, e, i, j, k, l, m, p, n, q, r, t, u, val, w,
                        tc, mn = 2134567891, mx = 0, sum = 0, ans = 0;
    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;
  }
  return 0;
}
