program cch(input,output);
const
minf=-100000000;
var
f,g:array[0..1000] of longint;
s,p,i,t:longint;
flag:boolean;
begin
assign(input,'goat.in');
assign(output,'goat.out');
reset(input);
rewrite(output);
readln(s,p);
f[0]:=0;
for i:=1 to p do f[i]:=minf;
flag:=true;
g:=f; t:=0;
while flag do
begin
inc(t);
for i:=0 to p-1 do
begin
g[i]:=f[i+1]+1;
if (i=0)and(f[0]+1>g[i]) then g[i]:=f[0]+1;
if (i>=2)and(f[i-2]+5>g[i]) then g[i]:=f[i-2]+5;
if (i>=5)and(f[i-5]+10>g[i]) then g[i]:=f[i-5]+10;
if g[i]>=s then
begin
write(t);
close(input); close(output);
halt;
end;
end;
f:=g;
end;
close(input);
close(output);
end.