#include <bits/stdc++.h>
int main() {
  int n, k, l, c, d, p, nl, np, i, j, z;
  scanf("%d %d %d %d %d %d %d %d", &n, &k, &l, &c, &d, &p, &nl, &np);
  int total_drink = (k * l / nl) / n;
  int total_lime = c * d / n;
  int total_salt = (p / np) / n;
  int arr[3] = {total_drink, total_lime, total_salt};
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (arr[j] > arr[i]) {
        z = arr[i];
        arr[i] = arr[j];
        arr[j] = z;
      }
    }
  }
  printf("%d", arr[0]);
  return 0;
}
