program goat;
type
shuzu=array[-8..100] of longint;
shuzu1=array[1..3] of longint;
var
f,b:shuzu;
flag:boolean;
m:shuzu1;
t,p,i,j,k,n,temp,s,min:longint;
begin
assign(input,'goat.in');reset(input);
assign(output,'goat.out');rewrite(output);
readln(s,p);
flag:=true;
t:=0;
while flag do
begin
inc(t);
for j:=0 to p do
begin
f[j]:=b[j+1]+1;
if b[0]+1>f[j] then f[j]:=b[0]+1;
if (b[j-2]+5>f[j])and(j-2>0) then f[j]:=b[j-2]+5;
if (b[j-5]+10>f[j])and(j-5>0) then f[j]:=b[j-5]+10;
if f[j]>=s then begin flag:=false; writeln(t); close(output); halt;end;
end;
for k:=0 to p do
b[k]:=f[k];
end;
close(output);
end.