
'''simple docstring'''
def        A_     (						__SCREAMING_SNAKE_CASE						:  int )				->       int:
  __A		:     Any												=		[1]

  __A		:     int												=		0, 0, 0
  __A		:     Optional[int]												=		ugly_nums[ia] * 2
  __A		:     int												=		ugly_nums[ia] * 3
  __A		:     List[Any]												=		ugly_nums[ia] * 5

  for _ in range(1			,     __SCREAMING_SNAKE_CASE ):
    __A		:     Any												=		min(__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )
    ugly_nums.append(__SCREAMING_SNAKE_CASE )
    if next_num == next_a:
      ia += 1
      __A		:     int												=		ugly_nums[ia] * 2
    if next_num == next_a:
      ia += 1
      __A		:     List[Any]												=		ugly_nums[ia] * 3
    if next_num == next_a:
      ia += 1
      __A		:     Union[str, Any]												=		ugly_nums[ia] * 5
  return ugly_nums[-1]


if __name__ == "__main__":
     from doctest import testmod

     testmod(verbose=True)
     print(F"{ugly_numbers(200) = }")





'''simple docstring'''
from __future__ import annotations







def        A_     (						__SCREAMING_SNAKE_CASE						:  list[int] )				->       int:





  """simple docstring"""

  if not nums:
    return 0
  __A		:     List[Any]												=		nums[0]
  __A		:     Union[str, Any]												=		0
  for num in nums[1:]:
    __A							,					__A		:     Union[str, Any]												=		(
        max_excluding + num,
        max(__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE ),
    )
  return max(__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )


if __name__ == "__main__":
     import doctest

     doctest.testmod()



