import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.container;
import std.bigint;

void main()
{
    auto inp = readln.split.map!(to!int).array;
    int cnt;
    auto num = [1, 1, 2, 7, 4];
    while (1) {
        foreach (i; 0..5) {
            inp[i] -= num[i];
        }
        if (inp.count!(a => a <0)) break;
        else cnt++;
    }
    cnt.writeln;
}