#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, z, a, b;
  cin >> x >> y >> z >> a >> b;
  vector<int> v;
  v.push_back(x);
  v.push_back(y);
  v.push_back(z / 2);
  v.push_back(a / 7);
  v.push_back(b / 4);
  cout << *min_element(v.begin(), v.end());
  return 0;
}
