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