using System;
class Solution {
private int traduction(string S){
int c=0;
for(int i=0; i<S.Length;i=i+1){
int c2=1;
for(int k=0;k<(S.Length-i);k=k+1){
c2=c2*2;
}
c=c2+c;
return c;
public int solution(string S) {
int n= traduction(S);
while(c!=0){
if ((n/2)*2==n){
c=c/2;
else{
c=c*3+1;
public class Program
{
public static void Main()