#include <bits/stdc++.h>
using namespace std;
int recipe[5] = {1, 1, 2, 7, 4};
int main() {
  int res = 500;
  for (int i = 0; i < 5; ++i) {
    int a;
    cin >> a;
    res = min(res, a / recipe[i]);
  }
  cout << res;
}
