#include <bits/stdc++.h>
using namespace std;
int main() {
  int xs, ws, cg, q, f;
  while (~scanf("%d %d %d %d %d", &xs, &ws, &cg, &q, &f)) {
    int sum = 0;
    while (xs >= 1 && ws >= 1 && cg >= 2 && q >= 7 && f >= 4) {
      sum++;
      xs -= 1;
      ws -= 1;
      cg -= 2;
      q -= 7;
      f -= 4;
    }
    printf("%d\n", sum);
  }
}
