import java.util.*;
public class Main {
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a1 = sc.nextInt();
        int prev = 0;
        Set<Integer> used = new HashSet<>();
      	for (int i = 1; ; i++) {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        }
	}
  
    private static int helper(int n) {
    	if (n % 2 == 0) {
        	return n / 2;
        } else {
        	return 3 * n + 1;
        }
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a1 = sc.nextInt();
        int prev = 0;
        Set<Integer> used = new HashSet<>();
      	for (int i = 1; ; i++) {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        }
	}
  
    private static int helper(int n) {
    	if (n % 2 == 0) {
        	return n / 2;
        } else {
        	return 3 * n + 1;
        }
    }
} Main public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a1 = sc.nextInt();
        int prev = 0;
        Set<Integer> used = new HashSet<>();
      	for (int i = 1; ; i++) {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        }
	} main {
      	Scanner sc = new Scanner(System.in);
      	int a1 = sc.nextInt();
        int prev = 0;
        Set<Integer> used = new HashSet<>();
      	for (int i = 1; ; i++) {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        }
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a1 = sc.nextInt(); a1 sc.nextInt() sc.nextInt sc int prev = 0; prev 0 Set<Integer> used = new HashSet<>(); used new HashSet<>() for (int i = 1; ; i++) {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        } int i = 1; int i = 1; i 1 i++ i++ i {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        } {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        } if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            } i == 1 i 1 {
            	used.add(a1);
              	prev = a1;
            } used.add(a1) used.add used a1 prev = a1 prev a1 {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            } int val = helper(prev); val helper(prev) helper prev if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                } used.contains(val) used.contains used val {
                	System.out.println(i);
                  	break;
                } System.out.println(i) System.out.println System.out System System.out i break; {
                	used.add(val);
                  	prev = val;
                } used.add(val) used.add used val prev = val prev val String[] args args private static int helper(int n) {
    	if (n % 2 == 0) {
        	return n / 2;
        } else {
        	return 3 * n + 1;
        }
    } helper {
    	if (n % 2 == 0) {
        	return n / 2;
        } else {
        	return 3 * n + 1;
        }
    } if (n % 2 == 0) {
        	return n / 2;
        } else {
        	return 3 * n + 1;
        } n % 2 == 0 n % 2 n 2 0 {
        	return n / 2;
        } return n / 2; n / 2 n 2 {
        	return 3 * n + 1;
        } return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n public class Main {
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a1 = sc.nextInt();
        int prev = 0;
        Set<Integer> used = new HashSet<>();
      	for (int i = 1; ; i++) {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        }
	}
  
    private static int helper(int n) {
    	if (n % 2 == 0) {
        	return n / 2;
        } else {
        	return 3 * n + 1;
        }
    }
} public class Main {
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a1 = sc.nextInt();
        int prev = 0;
        Set<Integer> used = new HashSet<>();
      	for (int i = 1; ; i++) {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        }
	}
  
    private static int helper(int n) {
    	if (n % 2 == 0) {
        	return n / 2;
        } else {
        	return 3 * n + 1;
        }
    }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
      	Scanner sc = new Scanner(System.in);
      	int a1 = sc.nextInt();
        int prev = 0;
        Set<Integer> used = new HashSet<>();
      	for (int i = 1; ; i++) {
          	if (i == 1) {
            	used.add(a1);
              	prev = a1;
            } else {
            	int val = helper(prev);
              	if (used.contains(val)) {
                	System.out.println(i);
                  	break;
                } else {
                	used.add(val);
                  	prev = val;
                }
            }
        }
	}
  
    private static int helper(int n) {
    	if (n % 2 == 0) {
        	return n / 2;
        } else {
        	return 3 * n + 1;
        }
    }
}