import java.io.*;
import java.util.*;

class Main {
	public static void main(String args[]) {
    	Scanner sc = new Scanner(System.in);;
            Map<Integer,Integer> table = new HashMap<Integer,Integer>();
            int n = sc.nextInt();
            int count = 1;
            while(!table.containsKey(n)) {
                table.put(n,count);
                count++;
                if( (n & 1) == 1) {
                    n = 3*n + 1;
                } else {
                    n = n >> 1;
                }
            }
            System.out.println(count);
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main {
	public static void main(String args[]) {
    	Scanner sc = new Scanner(System.in);;
            Map<Integer,Integer> table = new HashMap<Integer,Integer>();
            int n = sc.nextInt();
            int count = 1;
            while(!table.containsKey(n)) {
                table.put(n,count);
                count++;
                if( (n & 1) == 1) {
                    n = 3*n + 1;
                } else {
                    n = n >> 1;
                }
            }
            System.out.println(count);
    }
} Main public static void main(String args[]) {
    	Scanner sc = new Scanner(System.in);;
            Map<Integer,Integer> table = new HashMap<Integer,Integer>();
            int n = sc.nextInt();
            int count = 1;
            while(!table.containsKey(n)) {
                table.put(n,count);
                count++;
                if( (n & 1) == 1) {
                    n = 3*n + 1;
                } else {
                    n = n >> 1;
                }
            }
            System.out.println(count);
    } main {
    	Scanner sc = new Scanner(System.in);;
            Map<Integer,Integer> table = new HashMap<Integer,Integer>();
            int n = sc.nextInt();
            int count = 1;
            while(!table.containsKey(n)) {
                table.put(n,count);
                count++;
                if( (n & 1) == 1) {
                    n = 3*n + 1;
                } else {
                    n = n >> 1;
                }
            }
            System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Map<Integer,Integer> table = new HashMap<Integer,Integer>(); table new HashMap<Integer,Integer>() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int count = 1; count 1 while(!table.containsKey(n)) {
                table.put(n,count);
                count++;
                if( (n & 1) == 1) {
                    n = 3*n + 1;
                } else {
                    n = n >> 1;
                }
            } !table.containsKey(n) table.containsKey(n) table.containsKey table n {
                table.put(n,count);
                count++;
                if( (n & 1) == 1) {
                    n = 3*n + 1;
                } else {
                    n = n >> 1;
                }
            } table.put(n,count) table.put table n count count++ count if( (n & 1) == 1) {
                    n = 3*n + 1;
                } else {
                    n = n >> 1;
                } (n & 1) == 1 (n & 1) n 1 1 {
                    n = 3*n + 1;
                } n = 3*n + 1 n 3*n + 1 3*n 3 n 1 {
                    n = n >> 1;
                } n = n >> 1 n n >> 1 n 1 System.out.println(count) System.out.println System.out System System.out count String args[] args
import java.io.*;
import java.util.*;

class Main {
	public static void main(String args[]) {
    	Scanner sc = new Scanner(System.in);;
            Map<Integer,Integer> table = new HashMap<Integer,Integer>();
            int n = sc.nextInt();
            int count = 1;
            while(!table.containsKey(n)) {
                table.put(n,count);
                count++;
                if( (n & 1) == 1) {
                    n = 3*n + 1;
                } else {
                    n = n >> 1;
                }
            }
            System.out.println(count);
    }
}