import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;

public class Main{
  static int f1(int n){return n/2;}
  static int f2(int n){return 3*n+1;}


  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Integer> list = new ArrayList<Integer>();
    int s = sc.nextInt();

    list.add(s);
    int i=1;
    do{
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    }while(!(list.contains(s)));
    System.out.println(i);

  }

} import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main{
  static int f1(int n){return n/2;}
  static int f2(int n){return 3*n+1;}


  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Integer> list = new ArrayList<Integer>();
    int s = sc.nextInt();

    list.add(s);
    int i=1;
    do{
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    }while(!(list.contains(s)));
    System.out.println(i);

  }

} Main static int f1(int n){return n/2;} f1 {return n/2;} return n/2; n/2 n 2 int n n static int f2(int n){return 3*n+1;} f2 {return 3*n+1;} return 3*n+1; 3*n+1 3*n 3 n 1 int n n public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Integer> list = new ArrayList<Integer>();
    int s = sc.nextInt();

    list.add(s);
    int i=1;
    do{
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    }while(!(list.contains(s)));
    System.out.println(i);

  } main {
    Scanner sc = new Scanner(System.in);
    List<Integer> list = new ArrayList<Integer>();
    int s = sc.nextInt();

    list.add(s);
    int i=1;
    do{
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    }while(!(list.contains(s)));
    System.out.println(i);

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc list.add(s) list.add list s int i=1; i 1 do{
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    }while(!(list.contains(s))); !(list.contains(s)) (list.contains(s)) list.contains list s {
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    } list.add(s) list.add list s if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      } s%2==0 s%2 s 2 0 {
        s = f1(s);
      } s = f1(s) s f1(s) f1 s {
        s = f2(s);
      } s = f2(s) s f2(s) f2 s i++ i System.out.println(i) System.out.println System.out System System.out i String[] args args public class Main{
  static int f1(int n){return n/2;}
  static int f2(int n){return 3*n+1;}


  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Integer> list = new ArrayList<Integer>();
    int s = sc.nextInt();

    list.add(s);
    int i=1;
    do{
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    }while(!(list.contains(s)));
    System.out.println(i);

  }

} public class Main{
  static int f1(int n){return n/2;}
  static int f2(int n){return 3*n+1;}


  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Integer> list = new ArrayList<Integer>();
    int s = sc.nextInt();

    list.add(s);
    int i=1;
    do{
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    }while(!(list.contains(s)));
    System.out.println(i);

  }

} Main
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;

public class Main{
  static int f1(int n){return n/2;}
  static int f2(int n){return 3*n+1;}


  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    List<Integer> list = new ArrayList<Integer>();
    int s = sc.nextInt();

    list.add(s);
    int i=1;
    do{
      list.add(s);
      if(s%2==0){
        s = f1(s);
      }else{
        s = f2(s);
      }
      i++;
    }while(!(list.contains(s)));
    System.out.println(i);

  }

}