#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int s = 0;
  s = min(a, b);
  s = min(s, c / 2);
  s = min(s, d / 7);
  s = min(s, e / 4);
  cout << s << endl;
  return 0;
}
