#include <bits/stdc++.h>
int main() {
  int a, b, c, d, e;
  scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);
  printf("%d",
         ((a < ((b < ((c / 2 < ((d / 7 < e / 4) ? (d / 7) : (e / 4)))
                          ? (c / 2)
                          : (((d / 7 < e / 4) ? (d / 7) : (e / 4)))))
                    ? (b)
                    : (((c / 2 < ((d / 7 < e / 4) ? (d / 7) : (e / 4)))
                            ? (c / 2)
                            : (((d / 7 < e / 4) ? (d / 7) : (e / 4)))))))
              ? (a)
              : (((b < ((c / 2 < ((d / 7 < e / 4) ? (d / 7) : (e / 4)))
                            ? (c / 2)
                            : (((d / 7 < e / 4) ? (d / 7) : (e / 4)))))
                      ? (b)
                      : (((c / 2 < ((d / 7 < e / 4) ? (d / 7) : (e / 4)))
                              ? (c / 2)
                              : (((d / 7 < e / 4) ? (d / 7) : (e / 4)))))))));
}
