#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e, sum;
int main() {
  cin >> a >> b >> c >> d >> e;
  while (a >= 1 && b >= 1 && c >= 2 && d >= 7 && e >= 4) {
    sum++;
    a -= 1;
    b -= 1;
    c -= 2;
    d -= 7;
    e -= 4;
  }
  printf("%d", sum);
  return 0;
}
