#include <bits/stdc++.h>
using namespace std;
int main() {
  int n1, n2, n3, n4, n5, mn = 101;
  cin >> n1;
  mn = min(n1, mn);
  cin >> n2;
  mn = min(n2, mn);
  cin >> n3;
  mn = min(n3 / 2, mn);
  cin >> n4;
  mn = min(n4 / 7, mn);
  cin >> n5;
  mn = min(n5 / 4, mn);
  cout << mn;
  return 0;
}
