#include <bits/stdc++.h>
using namespace std;
int i, k, ans, sum;
int a[10];
int main() {
  for (int i = 1; i <= 8; i++) cin >> a[i];
  ans = a[2] * a[3] / a[7];
  ans = min(ans, a[4] * a[5]);
  ans = min(ans, a[6] / a[8]);
  cout << ans / a[1] << endl;
  return 0;
}
