#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, l, c, d, p, nl, np;
  cin >> n;
  cin >> k;
  cin >> l;
  cin >> c;
  cin >> d;
  cin >> p;
  cin >> nl;
  cin >> np;
  int x = (k * l) / nl;
  int y = (c * d);
  int z = p / np;
  int a = x >= y ? y : x;
  a = z >= a ? a : z;
  a = a / n;
  cout << a;
  return 0;
}
