
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.HashSet;
//import org.apache.commons.lang3.StringUtils;
 
 
/**
 *
 * @author aj
 */
public class Main {
    
    public static void main(String[] args){
        try {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }
} import java.io.BufferedInputStream; BufferedInputStream java.io import java.io.BufferedOutputStream; BufferedOutputStream java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStream; OutputStream java.io import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset import java.util.HashSet; HashSet java.util public class Main {
    
    public static void main(String[] args){
        try {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }
} Main public static void main(String[] args){
        try {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        }catch(Exception ex){
            ex.printStackTrace();
        }
    } main {
        try {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        }catch(Exception ex){
            ex.printStackTrace();
        }
    } try {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        }catch(Exception ex){
            ex.printStackTrace();
        } catch(Exception ex){
            ex.printStackTrace();
        } Exception ex {
            ex.printStackTrace();
        } ex.printStackTrace() ex.printStackTrace ex {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        } BufferedInputStream bf = new BufferedInputStream(System.in); bf new BufferedInputStream(System.in) BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8)); in new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8)) OutputStream out = new BufferedOutputStream ( System.out ); out new BufferedOutputStream ( System.out ) int s = Integer.parseInt(in.readLine()); s Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in int lim = 1000000 lim 1000000 i= 2 i 2 a = s; a s HashSet<Integer> set = new HashSet(); set new HashSet() set.add(s) set.add set s while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            } i<lim i lim {
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            } if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1; a%2==0 a%2 a 2 0 a = a / 2 a a / 2 a 2 a = 3 * a + 1 a 3 * a + 1 3 * a 3 a 1 if (!set.add(a)) break; !set.add(a) set.add(a) set.add set a break; i++ i out.write((i+"\n").getBytes()) out.write out (i+"\n").getBytes() (i+"\n").getBytes (i+"\n") i "\n" out.flush() out.flush out String[] args args public class Main {
    
    public static void main(String[] args){
        try {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }
} public class Main {
    
    public static void main(String[] args){
        try {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }
} Main

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.HashSet;
//import org.apache.commons.lang3.StringUtils;
 
 
/**
 *
 * @author aj
 */
public class Main {
    
    public static void main(String[] args){
        try {
            //Scanner sc = new Scanner(System.in);
            BufferedInputStream bf = new BufferedInputStream(System.in);
            BufferedReader in = new BufferedReader(
                    new InputStreamReader(bf, StandardCharsets.UTF_8));
            OutputStream out = new BufferedOutputStream ( System.out );
            
            int s = Integer.parseInt(in.readLine());
            int lim = 1000000,i= 2 , a = s;
            HashSet<Integer> set = new HashSet();
            set.add(s);
            while(i<lim){
                if (a%2==0) a = a / 2 ;
                else a = 3 * a + 1;
                if (!set.add(a)) break;
                i++;
            }
            out.write((i+"\n").getBytes());
            out.flush();
        }catch(Exception ex){
            ex.printStackTrace();
        }
    }
}