import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
        int s = sc.nextInt();
        
        Set<Integer> numericalSequence = new HashSet<Integer>() {};
        
        int tmp = s;
        numericalSequence.add(s);
        int ans = 0;
        
        for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        }

		
		System.out.println(ans);
	}
} HashSet<Integer>() {} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
        int s = sc.nextInt();
        
        Set<Integer> numericalSequence = new HashSet<Integer>() {};
        
        int tmp = s;
        numericalSequence.add(s);
        int ans = 0;
        
        for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        }

		
		System.out.println(ans);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
        int s = sc.nextInt();
        
        Set<Integer> numericalSequence = new HashSet<Integer>() {};
        
        int tmp = s;
        numericalSequence.add(s);
        int ans = 0;
        
        for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        }

		
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		
        int s = sc.nextInt();
        
        Set<Integer> numericalSequence = new HashSet<Integer>() {};
        
        int tmp = s;
        numericalSequence.add(s);
        int ans = 0;
        
        for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        }

		
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Set<Integer> numericalSequence = new HashSet<Integer>() {}; numericalSequence new HashSet<Integer>() {} int tmp = s; tmp s numericalSequence.add(s) numericalSequence.add numericalSequence s int ans = 0; ans 0 for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        } int i = 2; int i = 2; i 2 i < 1000000 i 1000000 i++ i++ i {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        } {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        } if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            } tmp % 2 == 0 tmp % 2 tmp 2 0 {
                tmp /= 2;
            } tmp /= 2 tmp 2 {
                tmp = 3 * tmp + 1;
            } tmp = 3 * tmp + 1 tmp 3 * tmp + 1 3 * tmp 3 tmp 1 if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            } numericalSequence.add(tmp) numericalSequence.add numericalSequence tmp {
        		numericalSequence.add(tmp);
            } numericalSequence.add(tmp) numericalSequence.add numericalSequence tmp {
            	ans = i;
                break;
            } ans = i ans i break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
        int s = sc.nextInt();
        
        Set<Integer> numericalSequence = new HashSet<Integer>() {};
        
        int tmp = s;
        numericalSequence.add(s);
        int ans = 0;
        
        for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        }

		
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
        int s = sc.nextInt();
        
        Set<Integer> numericalSequence = new HashSet<Integer>() {};
        
        int tmp = s;
        numericalSequence.add(s);
        int ans = 0;
        
        for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        }

		
		System.out.println(ans);
	}
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
        int s = sc.nextInt();
        
        Set<Integer> numericalSequence = new HashSet<Integer>() {};
        
        int tmp = s;
        numericalSequence.add(s);
        int ans = 0;
        
        for (int i = 2; i < 1000000; i++) {
        	
        	if (tmp % 2 == 0) {
                tmp /= 2;
            } else {
                tmp = 3 * tmp + 1;
            }
        	
        	if (numericalSequence.add(tmp)) {
        		numericalSequence.add(tmp);
            } else {
            	ans = i;
                break;
            }
        	
        }

		
		System.out.println(ans);
	}
}