#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  long long a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  cout << min(a, min(b, min(c / 2, min(d / 7, e / 4))));
  return 0;
}
