#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int ml = k * l;
  int t = ml / nl;
  int li = c * d;
  int s = p / np;
  vector<int> v;
  v.push_back(t);
  v.push_back(li);
  v.push_back(s);
  int min = *min_element(v.begin(), v.end());
  cout << min / n;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
