Pagini recente » Cod sursa (job #307969) | Cod sursa (job #2387849) | Cod sursa (job #1683134) | Cod sursa (job #2976790) | Cod sursa (job #362509)
Cod sursa(job #362509)
var f:text;
j,k,i,n,p:longint;
function keres(a:longint):longint;
var s,b:longint;
begin
s:=0;
b:=1;
while b<=a do
begin
b:=b*5;
s:=s+a div b;
end;
keres:=s;
end;
begin
assign(f,'fact.in');
reset(f);
readln(f,p);
close(f);
if p=0 then begin
i:=1;
end
else begin
i:=5;
while keres(i)<p do inc(i,5);
end;
assign(f,'fact.out');
rewrite(f);
writeln(f,i);
close(f);
end.