#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int N, M, T, K;
int cnt[50050];
int main() {
  ios::sync_with_stdio(false);
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int a = k * l / nl;
  int b = c * d;
  int cc = p / np;
  cout << min(a, min(b, cc)) / n;
}
