t=int(input())
for i in range(t):
s=int(input())
n=0
if s==1:
print(0)
else:
while s!=1:
if s%2==0:
s=s/2
else:
s=s*3+1
n+=1
print(n)
dD1pbnQoaW5wdXQoKSkKZm9yIGkgaW4gcmFuZ2UodCk6CglzPWludChpbnB1dCgpKQoJbj0wCglpZiBzPT0xOgoJCXByaW50KDApCgllbHNlOgoJCXdoaWxlIHMhPTE6CgkJCWlmIHMlMj09MDoKCQkJCXM9cy8yCgkJCWVsc2U6CgkJCQlzPXMqMysxCgkJCW4rPTEKCQlwcmludChuKQ==