





'''simple docstring'''

def    _a    (							lowerCAmelCase_	):





      """simple docstring"""



      _snake_case		:	int					     =     [1]

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

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


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

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









'''simple docstring'''

def    _a    (							lowerCAmelCase_	):





      """simple docstring"""



      if n == 1 or not isinstance(lowerCAmelCase_			,      lowerCAmelCase_	):
            return 0
      elif n == 2:
            return 1
      else:
            _snake_case		:	Union[str, Any]					     =     [0, 1]
            for i in range(2			,      n + 1	):
                  sequence.append(sequence[i - 1] + sequence[i - 2]	)

            return sequence[n]




def    _a    (							lowerCAmelCase_	):





      """simple docstring"""



      _snake_case		:	Optional[int]					     =     0
      _snake_case		:	int					     =     2

      while digits < n:
            index += 1
            _snake_case		:	Tuple					     =     len(str(fibonacci(lowerCAmelCase_	)	)	)

      return index




def    _a    (							lowerCAmelCase_ = 1_000	):





      """simple docstring"""



      return fibonacci_digits_index(lowerCAmelCase_	)


if __name__ == "__main__":
   print(solution(int(str(input()).strip())))


