#include <bits/stdc++.h>
using namespace std;
int main() {
  int friends;
  int bottle;
  int drink;
  int lime;
  int slice;
  int salt;
  int ml;
  int mg;
  cin >> friends >> bottle >> drink >> lime >> slice >> salt >> ml >> mg;
  drink *= bottle;
  slice *= lime;
  drink /= ml;
  salt /= mg;
  int toast = min(min(drink, slice), salt) / friends;
  cout << toast;
  return 0;
}
