#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
  int sol = a;
  sol = min(sol, b);
  sol = min(sol, c / 2);
  sol = min(sol, d / 7);
  sol = min(sol, e / 4);
  printf("%d\n", sol);
  return 0;
}
