#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  int R = c * d, B = k * l;
  int A = ((int)(B / nl)) < (R) ? ((int)(B / nl)) : (R);
  cout << ((A) < ((p / np)) ? (A) : ((p / np))) / n;
  return 0;
}
