#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int main() {
  int a[5];
  int b[5] = {1, 1, 2, 7, 4};
  int res = 10000000;
  for (int i = 0; i < (int)5; i++) {
    cin >> a[i];
    res = min(res, a[i] / b[i]);
  }
  cout << res << endl;
  return 0;
}
