PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SP0000033. Trò chơi lập danh sách (A List Game)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Trò chơi lập danh sách (A List Game)

A List Game

Source: Kattis

Version: Phuoc Hung OJ Extended

Problem Statement

Two friends play a game with positive integers. The first player chooses a positive integer XX. The second player writes a list of kk positive integers Y1,Y2,…,YkY_1,Y_2,\ldots,Y_k such that

(Y1+1)(Y2+1)⋯(Yk+1)=X.(Y_1+1)(Y_2+1)\cdots(Y_k+1)=X.

Every entry YiY_i must be at least 11. A valid list of kk entries earns the second player kk points.

You are the second player. Find the maximum number of points you can earn. Print only the maximum number of points, not the list itself.

Input

A single line containing the integer XX chosen by the first player.

Output

Print one integer: the largest possible kk for which a valid list exists.

Subtasks

  • Subtask 1 (20 points): 103≤X≤10510^3\le X\le10^5.
  • Subtask 2 (30 points): 103≤X≤10710^3\le X\le10^7.
  • Subtask 3 (50 points): 103≤X≤10910^3\le X\le10^9.

Examples

Input

1000

Output

6

Explanation

For X=1000X=1000, choose six entries: Y1=Y2=Y3=1Y_1=Y_2=Y_3=1 and Y4=Y5=Y6=4Y_4=Y_5=Y_6=4. Their corresponding factors yield

(1+1)3(4+1)3=23⋅53=8⋅125=1000.(1+1)^3(4+1)^3=2^3\cdot5^3=8\cdot125=1000.

A longer list would require splitting at least one of these six prime factors into a product of integers greater than 11. As 22 and 55 are prime, no such split exists. Therefore the answer is 66.

Input

2310

Output

5

Explanation

We have 2310=2⋅3⋅5⋅7⋅112310=2\cdot3\cdot5\cdot7\cdot11. The list [1,2,4,6,10][1,2,4,6,10] satisfies the product condition and scores 55 points. Each of the five factors is prime, so none can be split into smaller integers greater than 11 to make the list longer.