#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int q = 0;
  while (true) {
    if (a < 1 || b < 1 || c < 2 || d < 7 || e < 4) break;
    a--;
    b--;
    c -= 2;
    d -= 7;
    e -= 4;
    q++;
  }
  cout << q;
  return 0;
}
