import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int s = sc.nextInt();
        boolean ans = true;
        int count = 1;
      
        List<Integer> list = new ArrayList<Integer>();
        list.add(s);
        while(ans == true){
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        }
        
        
        
        System.out.println(count);
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int s = sc.nextInt();
        boolean ans = true;
        int count = 1;
      
        List<Integer> list = new ArrayList<Integer>();
        list.add(s);
        while(ans == true){
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        }
        
        
        
        System.out.println(count);
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int s = sc.nextInt();
        boolean ans = true;
        int count = 1;
      
        List<Integer> list = new ArrayList<Integer>();
        list.add(s);
        while(ans == true){
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        }
        
        
        
        System.out.println(count);
    } main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int s = sc.nextInt();
        boolean ans = true;
        int count = 1;
      
        List<Integer> list = new ArrayList<Integer>();
        list.add(s);
        while(ans == true){
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        }
        
        
        
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc boolean ans = true; ans true int count = 1; count 1 List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() list.add(s) list.add list s while(ans == true){
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        } ans == true ans true {
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        } if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          } s % 2 == 0 s % 2 s 2 0 {
            s = s / 2;
          } s = s / 2 s s / 2 s 2 {
            s = s * 3 + 1;
          } s = s * 3 + 1 s s * 3 + 1 s * 3 s 3 1 list.add(s) list.add list s ans = (list.size() == new HashSet<>(list).size()) ans (list.size() == new HashSet<>(list).size()) list.size() list.size list new HashSet<>(list).size() new HashSet<>(list).size new HashSet<>(list) count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int s = sc.nextInt();
        boolean ans = true;
        int count = 1;
      
        List<Integer> list = new ArrayList<Integer>();
        list.add(s);
        while(ans == true){
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        }
        
        
        
        System.out.println(count);
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int s = sc.nextInt();
        boolean ans = true;
        int count = 1;
      
        List<Integer> list = new ArrayList<Integer>();
        list.add(s);
        while(ans == true){
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        }
        
        
        
        System.out.println(count);
    }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int s = sc.nextInt();
        boolean ans = true;
        int count = 1;
      
        List<Integer> list = new ArrayList<Integer>();
        list.add(s);
        while(ans == true){
          if(s % 2 == 0){
            s = s / 2;
          }else{
            s = s * 3 + 1;
          }
          list.add(s);
           
          ans = (list.size() == new HashSet<>(list).size());
          count++;
        }
        
        
        
        System.out.println(count);
    }
}