import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    boolean[] b = new boolean[1000001];
    b[n] = true;
    int i = 2;
    while(true){
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    }
    System.out.println(i);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    boolean[] b = new boolean[1000001];
    b[n] = true;
    int i = 2;
    while(true){
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    }
    System.out.println(i);
  }
} Main public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    boolean[] b = new boolean[1000001];
    b[n] = true;
    int i = 2;
    while(true){
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    }
    System.out.println(i);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    boolean[] b = new boolean[1000001];
    b[n] = true;
    int i = 2;
    while(true){
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    }
    System.out.println(i);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc boolean[] b = new boolean[1000001]; b new boolean[1000001] 1000001 b[n] = true b[n] b n true int i = 2; i 2 while(true){
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    } true {
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    } 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 if(b[n]){
        break;
      }else{
        b[n] = true;
      } b[n] b n {
        break;
      } break; {
        b[n] = true;
      } b[n] = true b[n] b n true i++ i System.out.println(i) System.out.println System.out System System.out i String[]args args public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    boolean[] b = new boolean[1000001];
    b[n] = true;
    int i = 2;
    while(true){
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    }
    System.out.println(i);
  }
} public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    boolean[] b = new boolean[1000001];
    b[n] = true;
    int i = 2;
    while(true){
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    }
    System.out.println(i);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    boolean[] b = new boolean[1000001];
    b[n] = true;
    int i = 2;
    while(true){
      if(n%2 == 0){
        n /= 2;
      }else{
        n = n*3+1;
      }
      if(b[n]){
        break;
      }else{
        b[n] = true;
      }
      i++;
    }
    System.out.println(i);
  }
}