#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 count = floor((k * l) / nl);
  int count1 = c * d;
  int count2 = floor((p) / np);
  int min = count;
  if (count1 < min) {
    min = count1;
  }
  if (count2 < min) {
    min = count2;
  }
  min = floor(min / n);
  cout << min;
}
