import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Collections;
import java.awt.Point;


public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int s = Integer.parseInt(br.readLine());
        int[] a = new int[1000001];
        a[1] = s;
        
        for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        }
        
        for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        }
        
        
    }
}
 import java.util.*; util.* java import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io import java.util.Arrays; Arrays java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.ArrayDeque; ArrayDeque java.util import java.util.Deque; Deque java.util import java.util.Collections; Collections java.util import java.awt.Point; Point java.awt public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int s = Integer.parseInt(br.readLine());
        int[] a = new int[1000001];
        a[1] = s;
        
        for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        }
        
        for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        }
        
        
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int s = Integer.parseInt(br.readLine());
        int[] a = new int[1000001];
        a[1] = s;
        
        for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        }
        
        for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        }
        
        
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int s = Integer.parseInt(br.readLine());
        int[] a = new int[1000001];
        a[1] = s;
        
        for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        }
        
        for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        }
        
        
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int s = Integer.parseInt(br.readLine()); s Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int[] a = new int[1000001]; a new int[1000001] 1000001 a[1] = s a[1] a 1 s for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        } int i = 2; int i = 2; i 2 i < 1000001 i 1000001 i++ i++ i {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        } {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        } if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            } a[i-1]%2==0 a[i-1]%2 a[i-1] a i-1 i 1 2 0 {
                a[i] = a[i-1]/2;
            } a[i] = a[i-1]/2 a[i] a i a[i-1]/2 a[i-1] a i-1 i 1 2 {
                a[i] = 3*a[i-1]+1;
            } a[i] = 3*a[i-1]+1 a[i] a i 3*a[i-1]+1 3*a[i-1] 3 a[i-1] a i-1 i 1 1 for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        } int i = 2; int i = 2; i 2 i < 1000001 i 1000001 i++ i++ i {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        } {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        } for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            } int j = i-1; int j = i-1; j i-1 i 1 0 < j 0 j j-- j-- j {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            } {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            } if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                } a[i] == a[j] a[i] a i a[j] a j {
                    System.out.println(i);
                    return;
                } System.out.println(i) System.out.println System.out System System.out i return; String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int s = Integer.parseInt(br.readLine());
        int[] a = new int[1000001];
        a[1] = s;
        
        for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        }
        
        for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        }
        
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int s = Integer.parseInt(br.readLine());
        int[] a = new int[1000001];
        a[1] = s;
        
        for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        }
        
        for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        }
        
        
    }
} Main
import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Collections;
import java.awt.Point;


public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int s = Integer.parseInt(br.readLine());
        int[] a = new int[1000001];
        a[1] = s;
        
        for (int i = 2; i < 1000001; i++) {
            if (a[i-1]%2==0) {
                a[i] = a[i-1]/2;
            }
            else {
                a[i] = 3*a[i-1]+1;
            }
        }
        
        for (int i = 2; i < 1000001; i++) {
            for (int j = i-1; 0 < j; j--) {
                if (a[i] == a[j]) {
                    System.out.println(i);
                    return;
                }
            }
        }
        
        
    }
}

