#P2235. [HNOI2002] Kathy函数
[HNOI2002] Kathy函数
Description
Tiger likes math very much, so he joined the school's extracurricular math club. In the club, the teacher introduced the Kathy function to Tiger, which is defined as:
$$\left\{ \begin{aligned} &f(1)=1\\ &f(3)=3\\ &f(2n)=f(n)\\ &f(4n+1)=2f(2n+1)-f(n)\\ &f(4n+3)=3f(2n+1)-2f(n) \end{aligned} \right.$$Tiger became very interested in the Kathy function, and through studying he found that many numbers satisfy .
Given a number , he wants you to find the number of positive integers such that , where .
Input Format
The input contains a single line with an integer .
Output Format
Output a single integer: the number of positive integers with that satisfy .
5
3
Hint
Constraints
For all testdata, it is guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号