#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int k = min(d / 7, e / 4);
  int m = min(c / 2, k);
  int j = min(b, m);
  cout << min(j, a);
}
