#include <bits/stdc++.h>
using namespace std;
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
unsigned long long bpow(unsigned long long a, long long n, long long mod) {
  return n ? n & 1 ? (bpow(a, n - 1, mod) * a) % mod
                   : (bpow((a * a) % mod, n >> 1ll, mod)) % mod
           : 1ll;
}
bool is_upper(char c) { return (c >= 65 && c <= 90); }
bool is_lower(char c) { return (c >= 97 && c <= 122); }
int get_digit(long long num, int len, int index) {
  return num / bpow(10, len - index - 1, 1) % 10;
}
long long digit_sum(long long num) {
  long long dig_sum = 0;
  while (num > 0) {
    dig_sum += num % 10;
    num /= 10;
  }
  return dig_sum;
}
const long double EPS = 0.000001;
const long long MOD = 1000000007;
const int INF = 1e9 + 7;
const double pi = 2 * acos(0.0);
long long n, m, k, p, q, t, sum = 0, cnt = 0;
long long mx = INT64_MIN;
long long mn = INT64_MAX;
bool flag = 0;
vector<long long> v;
string s = "", s1, s2;
void bad_solve() {}
void solve() {
  long long n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  c *= d;
  k *= l;
  cout << min(k / nl, min(c, p / np)) / n;
}
int main() {
  cout.precision(20);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
