#include <bits/stdc++.h>
using namespace std;
void past_code();
int main() {
  int x, y, z, d, f;
  cin >> x >> y >> z >> d >> f;
  cout << min(min(x, y), min(z / 2, min(d / 7, f / 4))) << endl;
  return 0;
}
