#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;
  k = k * l / nl;
  c = d * c;
  p = p / np;
  int a[3];
  a[0] = k;
  a[1] = c;
  a[2] = p;
  sort(a, a + 3);
  cout << a[0] / n;
  return 0;
}
