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