#include <bits/stdc++.h>
using namespace std;
int l, k, mini, w, d, n, m, x, z, y, a[5], b, np, nl, c, p;
int main() {
  mini = 1000000;
  cin >> n >> k >> l >> c >> d >> p >> nl >> np;
  a[2] = p / np;
  a[0] = (l * k) / nl;
  a[1] = c * d;
  for (int i = 0; i < 3; i++) {
    if (a[i] < mini) mini = a[i];
  }
  cout << mini / n;
  return 0;
}
