import java.util.*;

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

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    Set<Integer> set = new HashSet<>();
    set.add(n);
    while(true){
      int m = set.size();
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      set.add(n);
      
      if(set.size() == m){
        break;
      }
    }
    System.out.println(set.size()+1);
  }
}