import java.util.*;
 
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int array[] = new int[1000000];
        array[0] = s;
        for(int i=1; i<array.length; i++){
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        }
        int index = 0;
        out:for(int i=0; i<array.length-1; i++){
                for(int j=i+1; j<array.length; j++){
                    if(array[i] == array[j]){
                        index = j;
                        break out;
                    }
                }
            }
        System.out.println(index+1);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int array[] = new int[1000000];
        array[0] = s;
        for(int i=1; i<array.length; i++){
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        }
        int index = 0;
        out:for(int i=0; i<array.length-1; i++){
                for(int j=i+1; j<array.length; j++){
                    if(array[i] == array[j]){
                        index = j;
                        break out;
                    }
                }
            }
        System.out.println(index+1);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int array[] = new int[1000000];
        array[0] = s;
        for(int i=1; i<array.length; i++){
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        }
        int index = 0;
        out:for(int i=0; i<array.length-1; i++){
                for(int j=i+1; j<array.length; j++){
                    if(array[i] == array[j]){
                        index = j;
                        break out;
                    }
                }
            }
        System.out.println(index+1);
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int array[] = new int[1000000];
        array[0] = s;
        for(int i=1; i<array.length; i++){
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        }
        int index = 0;
        out:for(int i=0; i<array.length-1; i++){
                for(int j=i+1; j<array.length; j++){
                    if(array[i] == array[j]){
                        index = j;
                        break out;
                    }
                }
            }
        System.out.println(index+1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int array[] = new int[1000000]; array new int[1000000] 1000000 array[0] = s array[0] array 0 s for(int i=1; i<array.length; i++){
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        } int i=1; int i=1; i 1 i<array.length i array.length array array.length i++ i++ i {
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        } {
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        } if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            } array[i-1] % 2 == 0 array[i-1] % 2 array[i-1] array i-1 i 1 2 0 {
                array[i] = array[i-1] / 2;
            } array[i] = array[i-1] / 2 array[i] array i array[i-1] / 2 array[i-1] array i-1 i 1 2 {
                array[i] = array[i-1] *3 +1;
            } array[i] = array[i-1] *3 +1 array[i] array i array[i-1] *3 +1 array[i-1] *3 array[i-1] array i-1 i 1 3 1 int index = 0; index 0 System.out.println(index+1) System.out.println System.out System System.out index+1 index 1 String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int array[] = new int[1000000];
        array[0] = s;
        for(int i=1; i<array.length; i++){
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        }
        int index = 0;
        out:for(int i=0; i<array.length-1; i++){
                for(int j=i+1; j<array.length; j++){
                    if(array[i] == array[j]){
                        index = j;
                        break out;
                    }
                }
            }
        System.out.println(index+1);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int array[] = new int[1000000];
        array[0] = s;
        for(int i=1; i<array.length; i++){
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        }
        int index = 0;
        out:for(int i=0; i<array.length-1; i++){
                for(int j=i+1; j<array.length; j++){
                    if(array[i] == array[j]){
                        index = j;
                        break out;
                    }
                }
            }
        System.out.println(index+1);
    }
} Main
import java.util.*;
 
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int array[] = new int[1000000];
        array[0] = s;
        for(int i=1; i<array.length; i++){
            if(array[i-1] % 2 == 0){
                array[i] = array[i-1] / 2;
            }
            else{
                array[i] = array[i-1] *3 +1;
            }
        }
        int index = 0;
        out:for(int i=0; i<array.length-1; i++){
                for(int j=i+1; j<array.length; j++){
                    if(array[i] == array[j]){
                        index = j;
                        break out;
                    }
                }
            }
        System.out.println(index+1);
    }
}