#include <bits/stdc++.h>
using namespace std;
const int maxN = 1E2 + 10;
const int mod = 1E9 + 7;
int a[maxN];
int32_t main() {
  for (int i = 0; i < 5; i++) cin >> a[i];
  cout << min(a[0], min(a[1], min(a[2] / 2, min(a[3] / 7, a[4] / 4)))) << endl;
  return 0;
}
