#include <bits/stdc++.h>
const double eps = 1e-7;
const int inf = 0x7FFFFFFF;
using namespace std;
int hash[110];
int num[6];
int main() {
  int x, ans = inf;
  for (int i = 0; i < 5; i++) cin >> num[i];
  ans = min(num[0], num[1]);
  ans = min(ans, num[2] / 2);
  ans = min(ans, num[3] / 7);
  ans = min(ans, num[4] / 4);
  cout << ans << endl;
  return 0;
}
