Pagini recente » Cod sursa (job #2130453) | Cod sursa (job #259155) | Cod sursa (job #2166988) | Cod sursa (job #699601) | Cod sursa (job #903708)
Cod sursa(job #903708)
var
input,output:text;
n,imp,i,m:int64;
begin
assign(input, 'fact.in'); reset(input);
assign(output, 'fact.out'); rewrite(output);
read(input,n);
close(input);
imp:=0;
i:=0;
if n>0 then
begin
repeat
begin
i:=i+5;
m:=i;
while (m mod 5)=0 do
begin
imp:=imp+1;
m:=m div 5;
end;
end;
until (imp=n) or (imp>n);
if (imp>n) then writeln(output,'-1') else writeln(output,i);
end
else
writeln(output,'1');
close(output);
end.