

'''simple docstring'''

from __future__ import annotations

lowercase__            =     "Alexander Joslin"




def  UpperCamelCase(	UpperCAmelCase_      ):

 if number <= 0:
  UpperCAmelCase			:      Tuple		   =					F"""n must be greater than 0. Got n = {number}"""
  raise ValueError(UpperCAmelCase_      )

 UpperCAmelCase			:      Any		   =					[number + 1] * (number + 1)

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


if __name__ == "__main__":
 import doctest

 doctest.testmod()







'''simple docstring'''

def  UpperCamelCase(	UpperCAmelCase_ = 1_00      ):
 UpperCAmelCase			:      Optional[Any]		   =					[[0 for _ in range(UpperCAmelCase_      )] for _ in range(m + 1      )]
 for i in range(m + 1      ):
  UpperCAmelCase			:      Optional[int]		   =					1

 for n in range(m + 1      ):
  for k in range(1    ,			UpperCAmelCase_      ):
   memo[n][k] += memo[n][k - 1]
   if n > k:
    memo[n][k] += memo[n - k - 1][k]

 return memo[m][m - 1] - 1


if __name__ == "__main__":
 print(solution(int(input("Enter a number: ").strip())))




