#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k, l, c, d, p, nl, np, ans = 0, m_d = 0, t = 0, li = 0, s = 0;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  m_d = k * l;
  t = m_d / nl;
  li = c * d;
  s = p / np;
  ans = min(min(t, li), s) / n;
  cout << ans;
}
