#include <bits/stdc++.h>
using namespace std;
const int need[] = {1, 1, 2, 7, 4};
int main() {
  int ans = (0x3f3f3f3f);
  int x, n = 0;
  while (cin >> x) {
    ans = min(ans, x / need[n++ % 5]);
  }
  cout << ans << endl;
  return 0;
}
