#include <stdio.h> int main() { int a; while(scanf("%d",&a)!=EOF){ if(a<1) return -1; int sum=0; while(a!=1){ if(a%2==0) a/=2; else a=(3*a+1)/2; sum+=1; } printf("%d\n",sum); } return 0; }
#include <stdio.h> int main() { int a; while(scanf("%d",&a)!=EOF){ if(a<1) return -1; int sum=0; while(a!=1){ if(a%2==0) a/=2; else a=(3*a+1)/2; sum+=1; } printf("%d\n",sum); } return 0; }