You must have known the sequence define as follows:
a[1]=1;
for every i=1,2,3,...
a[2*i]=a[i];
a[2*i+1]=a[i]+a[i+1];
You can easily prove that every postive number will appear in this sequence.
Now give you a postive number n,your task is to determine the first position n appears.
Input
Only one number n (0<n<400000).
Output
The first position n appears.The answer won't exceed 2^{63}-1