import java.util.*;
public class Main {
   public static void main(String[] args) {  
      Scanner sc = new Scanner(System.in);
      
      int a = sc.nextInt();
      HashSet<Integer> hs = new HashSet<Integer>();
      while(!hs.contains(a)) {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      }
      System.out.println(hs.size() + 1);
   }
} import java.util.*; util.* java public class Main {
   public static void main(String[] args) {  
      Scanner sc = new Scanner(System.in);
      
      int a = sc.nextInt();
      HashSet<Integer> hs = new HashSet<Integer>();
      while(!hs.contains(a)) {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      }
      System.out.println(hs.size() + 1);
   }
} Main public static void main(String[] args) {  
      Scanner sc = new Scanner(System.in);
      
      int a = sc.nextInt();
      HashSet<Integer> hs = new HashSet<Integer>();
      while(!hs.contains(a)) {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      }
      System.out.println(hs.size() + 1);
   } main {  
      Scanner sc = new Scanner(System.in);
      
      int a = sc.nextInt();
      HashSet<Integer> hs = new HashSet<Integer>();
      while(!hs.contains(a)) {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      }
      System.out.println(hs.size() + 1);
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc HashSet<Integer> hs = new HashSet<Integer>(); hs new HashSet<Integer>() while(!hs.contains(a)) {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      } !hs.contains(a) hs.contains(a) hs.contains hs a {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      } hs.add(a) hs.add hs a if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         } a % 2 == 1 a % 2 a 2 1 {
            a = 3 * a + 1;
         } a = 3 * a + 1 a 3 * a + 1 3 * a 3 a 1 {
            a /= 2;
         } a /= 2 a 2 System.out.println(hs.size() + 1) System.out.println System.out System System.out hs.size() + 1 hs.size() hs.size hs 1 String[] args args public class Main {
   public static void main(String[] args) {  
      Scanner sc = new Scanner(System.in);
      
      int a = sc.nextInt();
      HashSet<Integer> hs = new HashSet<Integer>();
      while(!hs.contains(a)) {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      }
      System.out.println(hs.size() + 1);
   }
} public class Main {
   public static void main(String[] args) {  
      Scanner sc = new Scanner(System.in);
      
      int a = sc.nextInt();
      HashSet<Integer> hs = new HashSet<Integer>();
      while(!hs.contains(a)) {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      }
      System.out.println(hs.size() + 1);
   }
} Main
import java.util.*;
public class Main {
   public static void main(String[] args) {  
      Scanner sc = new Scanner(System.in);
      
      int a = sc.nextInt();
      HashSet<Integer> hs = new HashSet<Integer>();
      while(!hs.contains(a)) {
         hs.add(a);
         if(a % 2 == 1) {
            a = 3 * a + 1;
         }
         else {
            a /= 2;
         }
      }
      System.out.println(hs.size() + 1);
   }
}