prog;

factorial (i : int) : int;
begin
  if i <= 2 then
    return i;
  end if;
  return i * factorial (i - 1);
end;
end factorial

begin
  write factorial (5);
end;

end prog
