#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = ' ';
  int f = 1, x = 0;
  while (!isdigit(ch)) {
    ch = getchar();
    if (ch == '-') f *= -1;
  }
  while (isdigit(ch)) {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return f * x;
}
int a[5] = {1, 1, 2, 7, 4};
int b[5], ans;
int main() {
  ans = 1000000000;
  for (int i = 0; i < 5; i++) {
    cin >> b[i];
    ans = min(ans, b[i] / a[i]);
  }
  cout << ans;
  return 0;
}
