






"""simple docstring"""





from __future__ import annotations

A__       :			Tuple=						"""Alexander Joslin"""







def 	lowerCAmelCase_(			SCREAMING_SNAKE_CASE       )       ->						int:
    """simple docstring"""

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

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

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


if __name__ == "__main__":
  import doctest

  doctest.testmod()












"""simple docstring"""





from math import gcd







def 	lowerCAmelCase_(			SCREAMING_SNAKE_CASE = 1_20_00       )       ->						int:
    """simple docstring"""

    UpperCamelCase__								=     0
    for d in range(max_d + 1       ):
        for n in range(d // 3 + 1			,						(d + 1) // 2       ):
            if gcd(SCREAMING_SNAKE_CASE			,						SCREAMING_SNAKE_CASE       ) == 1:
                fractions_number += 1
    return fractions_number


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




