#include <bits/stdc++.h>
using namespace std;
int main() {
  int c[] = {1, 1, 2, 7, 4};
  int x, ret = 1e9;
  for (int i = 0; i < 5; i++) {
    cin >> x;
    ret = min(ret, x / c[i]);
  }
  cout << ret << endl;
  return 0;
}
