#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k, l, c, d, p, nl, np, a, b, x, y, z, h;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  a = k * l;
  b = a / nl;
  x = c * d;
  y = p / np;
  z = min(b, x);
  h = min(z, y) / n;
  cout << h << endl;
}
