#include <bits/stdc++.h>
using namespace std;
int a[10000], b, c, n, m, x, y, z, p, s;
string st1, st2;
int main() {
  cin >> b >> c >> x >> y >> z;
  a[1] = b / 1;
  a[2] = c / 1;
  a[3] = x / 2;
  a[4] = y / 7;
  a[5] = z / 4;
  sort(a + 1, a + 6);
  cout << a[1];
  return 0;
}
