import java.util.*;
public class Main{
  	public static int[] array = new int[100000];
  public static int count = 1;
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      array[0] = s;
      System.out.println(run(s));
      
    }
  	public static int run(int s){
      	if(count > 1)
        for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        }
    	if(s%2==0){
          array[count] = s/2;
          count++;
          return run(s/2);
        }
        else{
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        }
    }
} import java.util.*; util.* java public class Main{
  	public static int[] array = new int[100000];
  public static int count = 1;
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      array[0] = s;
      System.out.println(run(s));
      
    }
  	public static int run(int s){
      	if(count > 1)
        for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        }
    	if(s%2==0){
          array[count] = s/2;
          count++;
          return run(s/2);
        }
        else{
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        }
    }
} Main public static int[] array = new int[100000]; array new int[100000] 100000 public static int count = 1; count 1 public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      array[0] = s;
      System.out.println(run(s));
      
    } main {
    	Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      array[0] = s;
      System.out.println(run(s));
      
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc array[0] = s array[0] array 0 s System.out.println(run(s)) System.out.println System.out System System.out run(s) run s String[] args args public static int run(int s){
      	if(count > 1)
        for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        }
    	if(s%2==0){
          array[count] = s/2;
          count++;
          return run(s/2);
        }
        else{
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        }
    } run {
      	if(count > 1)
        for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        }
    	if(s%2==0){
          array[count] = s/2;
          count++;
          return run(s/2);
        }
        else{
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        }
    } if(count > 1)
        for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        } count > 1 count 1 for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        } int i = 0; int i = 0; i 0 i<count-1 i count-1 count 1 i++ i++ i {
        	if(array[count-1] == array[i]){
            	return count;
            }
        } {
        	if(array[count-1] == array[i]){
            	return count;
            }
        } if(array[count-1] == array[i]){
            	return count;
            } array[count-1] == array[i] array[count-1] array count-1 count 1 array[i] array i {
            	return count;
            } return count; count if(s%2==0){
          array[count] = s/2;
          count++;
          return run(s/2);
        }
        else{
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        } s%2==0 s%2 s 2 0 {
          array[count] = s/2;
          count++;
          return run(s/2);
        } array[count] = s/2 array[count] array count s/2 s 2 count++ count return run(s/2); run(s/2) run s/2 s 2 {
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        } array[count] = s*3+1 array[count] array count s*3+1 s*3 s 3 1 count++ count return run(s*3+1); run(s*3+1) run s*3+1 s*3 s 3 1 int s s public class Main{
  	public static int[] array = new int[100000];
  public static int count = 1;
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      array[0] = s;
      System.out.println(run(s));
      
    }
  	public static int run(int s){
      	if(count > 1)
        for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        }
    	if(s%2==0){
          array[count] = s/2;
          count++;
          return run(s/2);
        }
        else{
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        }
    }
} public class Main{
  	public static int[] array = new int[100000];
  public static int count = 1;
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      array[0] = s;
      System.out.println(run(s));
      
    }
  	public static int run(int s){
      	if(count > 1)
        for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        }
    	if(s%2==0){
          array[count] = s/2;
          count++;
          return run(s/2);
        }
        else{
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        }
    }
} Main
import java.util.*;
public class Main{
  	public static int[] array = new int[100000];
  public static int count = 1;
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int s = sc.nextInt();
      array[0] = s;
      System.out.println(run(s));
      
    }
  	public static int run(int s){
      	if(count > 1)
        for(int i = 0;i<count-1;i++){
        	if(array[count-1] == array[i]){
            	return count;
            }
        }
    	if(s%2==0){
          array[count] = s/2;
          count++;
          return run(s/2);
        }
        else{
          array[count] = s*3+1;
          count++;
          return run(s*3+1);
        }
    }
}