#include <bits/stdc++.h>
int main(void) {
  int a[5];
  int Min;
  while (scanf("%d%d%d%d%d", a, a + 1, a + 2, a + 3, a + 4) != EOF) {
    Min = a[0];
    if (a[1] < Min) Min = a[1];
    if (a[2] / 2 < Min) Min = a[2] / 2;
    if (a[3] / 7 < Min) Min = a[3] / 7;
    if (a[4] / 4 < Min) Min = a[4] / 4;
    printf("%d\n", Min);
  }
  return EXIT_SUCCESS;
}
