import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	long n, a, b, c, d, e;
	while (readf (" %s %s %s %s %s %s", &n, &a, &b, &c, &d, &e) > 0)
	{
		long res = 0;
		res = max (res, n / a);
		res = max (res, n / b);
		res = max (res, n / c);
		res = max (res, n / d);
		res = max (res, n / e);
		res += 5;
		writeln (res);
	}
}
