#include <bits/stdc++.h>
using namespace std;
inline int MAX(int a, int b) { return a < b ? b : a; }
inline int MIN(int a, int b) { return a > b ? b : a; }
int n, k, l, c, d, p, nl, np;
int cantb, toast, slices;
int main() {
  scanf("%d%d%d%d%d%d%d%d", &n, &k, &l, &c, &d, &p, &nl, &np);
  printf("%d\n", MIN(l * k / nl, MIN(c * d, p / np)) / n);
  return 0;
}
