#include <bits/stdc++.h>
const long double eps = 1e-9;
const double pi = acos(-1.0);
const long long inf = 1e18;
using namespace std;
int min(int a, int b, int c, int d, int e) {
  return min(a, min(b, min(c, min(d, e))));
}
int main(int argc, const char* argv[]) {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  cout << min(a, b, c / 2, d / 7, e / 4) << "\n";
  return 0;
}
