#Q157. 「一本通 5.2 例 3」数字转换

「一本通 5.2 例 3」数字转换

Description

If the sum of the divisors (excluding itself) of a number xx, denoted as yy, is less than xx itself, then xx can be transformed into yy, and yy can also be transformed into xx. For example, 44 can be transformed into 33, and 11 can be transformed into 77. All transformations are constrained to positive integers not exceeding nn. Find the maximum number of transformation steps possible without repeating any numbers.

Input Format

Input a positive integer nn.

Output Format

Output the maximum number of transformation steps possible without repeating any numbers.

Sample 1

One possible transformation sequence is 43174\to 3\to 1\to 7.

7

3

Data Range and Hint

For 100%100\% of the data, 1n500001\le n \le 50000.