





"""simple docstring"""


from __future__ import annotations

a__					:     int							=				'''Alexander Joslin'''





def 	a__			(  _UpperCAmelCase	)    ->  int:

 '''simple docstring'''






 if number <= 0:
  snake_case__    							=				f"n must be greater than 0. Got n = {number}"
  raise ValueError(__lowerCAmelCase	)

 snake_case__    							=				[number + 1] * (number + 1)

 # starting position
 snake_case__    							=				0
 for i in range(1	,     __lowerCAmelCase	):
  snake_case__    							=				min(table[i + 1]	,     table[i] + 1	)
  # check if out of bounds
  if i * 2 <= number:
   snake_case__    							=				min(table[i * 2]	,     table[i] + 1	)
  # check if out of bounds
  if i * 3 <= number:
   snake_case__    							=				min(table[i * 3]	,     table[i] + 1	)
 return table[number]


if __name__ == "__main__":
   import doctest

   doctest.testmod()








"""simple docstring"""


def 							a__			(  _UpperCAmelCase = 1_0_0_0	)    ->  int:

 '''simple docstring'''






 snake_case__    							=				[]
 snake_case__    							=				[]
 snake_case__    							=				3
 snake_case__    							=				5
 snake_case__    							=				1
 while True:
  snake_case__    							=				z * temp
  if result < n:
   zmulti.append(_UpperCAmelCase	)
   temp += 1
  else:
   snake_case__    							=				1
   break
 while True:
  snake_case__    							=				x * temp
  if result < n:
   xmulti.append(_UpperCAmelCase	)
   temp += 1
  else:
   break
 snake_case__    							=				list(set(xmulti + zmulti	)	)
 return sum(_UpperCAmelCase	)


if __name__ == "__main__":
   print(f'''{solution() = }''')

