#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr1[5];
  while (cin >> arr1[0]) {
    for (int k = 1; k < 5; k++) cin >> arr1[k];
    int min = 999999, temp;
    int arr2[5] = {1, 1, 2, 7, 4};
    for (int i = 0; i < 5; i++) {
      temp = arr1[i] / arr2[i];
      if (temp < min) min = temp;
    }
    printf("%d\n", min);
  }
  return 0;
}
