import networkx as nx def make_divisors(n): lower_divisors, upper_divisors = [], [] i = 1 while i * i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n // i) i += 1 return lower_divisors + upper_divisors[::-1] def main(): n = int(input()) div_lst = make_divisors(n) graph = nx.Graph() for i in div_lst: for j in div_lst: if i == j: continue if j % i == 0: graph.add_edge(i, j, weight=j // i) print(nx.dijkstra_path_length(graph, 1, n)) if __name__ == "__main__": main()