#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  int b;
  int c;
  int d;
  int f;
  cin >> a >> b >> c >> d >> f;
  cout << min(a, min(b, min((c / 2), min((d / 7), (f / 4)))));
  return 0;
}
