var a,b,n:longint;begin readln(a,b); if a>b then begin n:=a; a:=b; b:=n end; n:=0; dec(a); while b>0 do begin inc(n,b div 5); b:=b div 5; end; while a>0 do begin dec(n,a div 5); a:=a div 5; end; writeln(n);end.