main=readLn>>=f f 1=p 1 f n|odd n=p n>>f(n*3+1) f n=p n>>f(n`div`2) p=print