def pong(receive: int) -> int:
    potential_service = receive - 1
    for service in range(potential_service, 0, -1):
        if not bool(receive % service):
            return service


bounce = 1
def ping(ball: int, bounce: int) -> int:
    while ball > 1:
        bounce += 1
        ball = pong(ball)
    return bounce


ball = int(input())
print(ping(ball, bounce))