#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np;
  int tom, tol, tos;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  tom = (k * l) / nl;
  tol = c * d;
  tos = p / np;
  int result = min(tom, tos);
  result = min(result, tol);
  result = result / n;
  cout << result;
}
