#include <bits/stdc++.h>
using namespace std;
int a[5];
int b[5] = {1, 1, 2, 7, 4};
const int INF = 200000000;
int main() {
  int answer = INF;
  for (int i = 0; i < 5; i++) {
    scanf("%d ", &a[i]);
    answer = min(answer, a[i] / b[i]);
  }
  printf("%d", answer);
  return 0;
}
