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