#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int friends, bottles, milimeter, lime, slice, gram, need_ml, need_g;
  cin >> friends >> bottles >> milimeter >> lime >> slice >> gram >> need_ml >>
      need_g;
  int temp = bottles * milimeter / need_ml;
  int temp2 = lime * slice;
  int temp3 = gram / need_g;
  cout << min(temp, min(temp2, temp3)) / friends;
}
