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