


'''simple docstring'''





from __future__ import annotations

__lowerCamelCase       				=	'''Alexander Joslin'''


def 					a__    (				UpperCamelCase_	:			int	):







   if number <= 0:
      UpperCAmelCase__  :Any            =			F'''n must be greater than 0. Got n = {number}'''
      raise ValueError(UpperCamelCase_	)

   UpperCAmelCase__  :Optional[int]            =			[number + 1] * (number + 1)

   # starting position
   UpperCAmelCase__  :Optional[Any]            =			0
   for i in range(1,      UpperCamelCase_	):
      UpperCAmelCase__  :List[str]            =			min(table[i + 1],      table[i] + 1	)
      # check if out of bounds
      if i * 2 <= number:
         UpperCAmelCase__  :str            =			min(table[i * 2],      table[i] + 1	)
      # check if out of bounds
      if i * 3 <= number:
         UpperCAmelCase__  :int            =			min(table[i * 3],      table[i] + 1	)
   return table[number]


if __name__ == "__main__":
    import doctest

    doctest.testmod()







'''simple docstring'''





def 					a__    (				UpperCamelCase_	:			int = 100	):
   UpperCAmelCase__  :List[str]            =			1
   UpperCAmelCase__  :Dict            =			0
   for i in range(1,      num + 1	):
      fact *= i

   for j in str(UpperCamelCase_	):
      result += int(UpperCamelCase_	)

   return result


if __name__ == "__main__":
    print(solution(int(input('''Enter the Number: ''').strip())))



