#include <bits/stdc++.h>
using namespace std;
template <typename X>
inline X abs(const X& a) {
  return a < 0 ? -a : a;
}
template <typename X>
inline X sqr(const X& a) {
  return a * a;
}
long long combine(long long n, int k) {
  long long ans = 1;
  for (int i = 0; i < k; i++) ans = (ans * (n - i)) / (i + 1);
  return ans;
}
long long pw(long long a, long long p) {
  if (p == 0) return 1;
  if (p == 1) return a;
  long long half = pw(a, p / 2);
  if (p % 2 == 0) return half * half;
  return half * half * a;
}
long long dis(pair<long long, long long> a, pair<long long, long long> b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  vector<int> v(5);
  int rp[5] = {1, 1, 2, 7, 4};
  for (int i = 0; i < 5; i++) cin >> v[i];
  for (int i = 0; i < 5; i++) {
    v[i] /= rp[i];
  }
  cout << *min_element((v).begin(), (v).end()) << endl;
  return 0;
}
