#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30);
const int MOD = 1000000007;
const int req[] = {1, 1, 2, 7, 4};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int ans = 100;
  for (int i = (0); i < (5); ++i) {
    int x;
    cin >> x;
    ans = min(ans, x / req[i]);
  }
  cout << ans;
  return 0;
}
