题目描述
Problem Description
PAKEN Botanical Garden is growing bamboo. E869120 observes the bamboo regularly.
The bamboo in the garden grows by 1.5 times every night. Specifically, when the height so far has been $ A $, the height increases to "the value of $A \times 1.5$ rounded down to the nearest integer".
For example, a bamboo that was 2 units tall at the beginning of the day will be 3 units tall at the beginning of the next day, and 4 units tall at the beginning of the day after that. Then, the height will increase to 6, 9, 13, 19, 28, ... respectively.
According to E869120's information, the height of the bamboo was an integer $ A $ when he observed it a few days ago (not today), but today, the height of the bamboo is an integer $ B $.
He had recorded the value of $ A $ in his notebook, but he lost his notebook.
Please help him find the number of possible values for $ A $.
Note that the bamboo does not grow at all during the day, only at night.
Input Format
The input is given from the standard input in the following format:
$ B $
Output Format
Find the number of possible values for $ A $ as described in the problem.
Sample Input and Output
Sample Input #1
10
Sample Output #1
2
Sample Input #2
5
Sample Output #2
0
Sample Input #3
8092
Sample Output #3
21
Sample Input #4
3687
Sample Output #4
12
Notes/Hints
Constraints
- $ B $ is an integer between 2 and 10000 inclusive.
Subtasks
Subtask $ 1 $ \[$ 30 $ points\]
- $B \leq 10$
Subtask $ 2 $ \[$ 70 $ points\]
- No additional constraints.
Sample Explanation 1
The possible values for $ A $ are 5 and 7, which are 2 possibilities. The changes in the height of the bamboo are as follows:
For $ A = 5 $: 5 → 7 → 10
For $ A = 7 $: 7 → 10
For any other value of $ A $, the height $ B $ today cannot be 10.
Sample Explanation 2
In this case, there are no possible values for $ A $. This is because:
For $ A = 1 $: 1 → 1 → 1 → ... (the bamboo does not grow at all)
For $ A = 2 $: 2 → 3 → 4 → 6 ...
For $ A = 3 $: 3 → 4 → 6 ...
For $ A = 4 $: 4 → 6 ...
For $ A = 5 $: Since the height $ B $ today is 5, the height of the bamboo measured before today cannot be 5
For $A \geq 6$: The bamboo does not shrink, so it is not possible
Therefore, the answer is 0 possibilities.
Sample Explanation 3
The maximum answer is when $ B = 8092 $, which is 21 possibilities.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分