Consider the following algorithm:

Given one integer n. Please output the count after processing the algorithm.
For example:
If n = 22, then according to the algorithm. You will get 22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1. Thus the count for 22 is 15.
The input contains several test cases and will end with EOF. In each test case, there is only one line contains an integer n.
For 9280: 1<=n<=1500
For 9281: 1<=n<=9000
For 9282: 1<=n<=100000
For 9283: 1<=n<=1000000
[Hint]
For 9280, the value during operation will not exceed 10^6. Time: 3s.
For 9281, the value during operation will not exceed 10^7. Time: 3s.
For 9282, the value during operation will not exceed 2^31. Time: 3s.
For 9283, the value during operation will not exceed 2^63. Time: 1s.
For 9283, and you may need to store the count of n that has already been calculated.
Please don't use cin/cout, or you will get TLE.
For each test case, output the count of n.