#include <bits/stdc++.h>
using namespace std;
int min(int a, int b, int c) {
  if (a < b) {
    if (a < c)
      return a;
    else
      return c;
  } else {
    if (b < c)
      return b;
    else
      return c;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    int k;
    cin >> k;
    int l;
    cin >> l;
    int c;
    cin >> c;
    int d;
    cin >> d;
    int p;
    cin >> p;
    int nl;
    cin >> nl;
    int np;
    cin >> np;
    int toasts = 0;
    int drinks = k * l;
    int limes = c * d;
    int a;
    a = k * l / nl;
    int b = c * d;
    int g = p / np;
    toasts = min(a, b, g);
    cout << toasts / n;
  }
  return 0;
}
