#include <bits/stdc++.h>
int main() {
  int arr[8];
  for (int i = 0; i < 8; i++) scanf("%d", &arr[i]);
  ;
  int a, b, c;
  a = (arr[1] * arr[2]) / arr[6];
  b = arr[3] * arr[4];
  c = arr[5] / arr[7];
  int d = a < b ? a : b;
  d = d < c ? d : c;
  printf("%d\n", d / arr[0]);
  return 0;
}
