import java.time.Year;
import java.util.*;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    // input
    static int s;

    /**
     * input
     */
    static void input(){
        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        sc.close();
    }
 

    static int f(int n) {
        if (n%2==0) {
            return n/2;
        } else {
            return 3*n+1;
        }
    }

    static boolean[] memo;

    /**
     * solver
     */
    static void solve(){
        memo = new boolean[1000000];

        int ans = 1;
        int x = s;
        memo[x] = true;

        int y;

        while(true) {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        }

        System.out.println(ans);
    }


    public static void main(String args[]) {

        input();

        solve();
    }
} import java.time.Year; Year java.time import java.util.*; util.* java import java.util.Scanner; Scanner java.util import java.util.stream.Collectors; Collectors java.util.stream public class Main {

    // input
    static int s;

    /**
     * input
     */
    static void input(){
        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        sc.close();
    }
 

    static int f(int n) {
        if (n%2==0) {
            return n/2;
        } else {
            return 3*n+1;
        }
    }

    static boolean[] memo;

    /**
     * solver
     */
    static void solve(){
        memo = new boolean[1000000];

        int ans = 1;
        int x = s;
        memo[x] = true;

        int y;

        while(true) {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        }

        System.out.println(ans);
    }


    public static void main(String args[]) {

        input();

        solve();
    }
} Main // input
    static int s; s static boolean[] memo; memo /**
     * input
     */
    static void input(){
        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        sc.close();
    } input {
        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) s = sc.nextInt() s sc.nextInt() sc.nextInt sc sc.close() sc.close sc static int f(int n) {
        if (n%2==0) {
            return n/2;
        } else {
            return 3*n+1;
        }
    } f {
        if (n%2==0) {
            return n/2;
        } else {
            return 3*n+1;
        }
    } if (n%2==0) {
            return n/2;
        } else {
            return 3*n+1;
        } n%2==0 n%2 n 2 0 {
            return n/2;
        } return n/2; n/2 n 2 {
            return 3*n+1;
        } return 3*n+1; 3*n+1 3*n 3 n 1 int n n /**
     * solver
     */
    static void solve(){
        memo = new boolean[1000000];

        int ans = 1;
        int x = s;
        memo[x] = true;

        int y;

        while(true) {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        }

        System.out.println(ans);
    } solve {
        memo = new boolean[1000000];

        int ans = 1;
        int x = s;
        memo[x] = true;

        int y;

        while(true) {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        }

        System.out.println(ans);
    } memo = new boolean[1000000] memo new boolean[1000000] 1000000 int ans = 1; ans 1 int x = s; x s memo[x] = true memo[x] memo x true int y; y while(true) {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        } true {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        } y = f(x) y f(x) f x ans ++ ans if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            } memo[y] memo y {
                break;
            } break; {
                memo[y] = true;
                x = y;
            } memo[y] = true memo[y] memo y true x = y x y System.out.println(ans) System.out.println System.out System System.out ans public static void main(String args[]) {

        input();

        solve();
    } main {

        input();

        solve();
    } input() input solve() solve String args[] args public class Main {

    // input
    static int s;

    /**
     * input
     */
    static void input(){
        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        sc.close();
    }
 

    static int f(int n) {
        if (n%2==0) {
            return n/2;
        } else {
            return 3*n+1;
        }
    }

    static boolean[] memo;

    /**
     * solver
     */
    static void solve(){
        memo = new boolean[1000000];

        int ans = 1;
        int x = s;
        memo[x] = true;

        int y;

        while(true) {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        }

        System.out.println(ans);
    }


    public static void main(String args[]) {

        input();

        solve();
    }
} public class Main {

    // input
    static int s;

    /**
     * input
     */
    static void input(){
        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        sc.close();
    }
 

    static int f(int n) {
        if (n%2==0) {
            return n/2;
        } else {
            return 3*n+1;
        }
    }

    static boolean[] memo;

    /**
     * solver
     */
    static void solve(){
        memo = new boolean[1000000];

        int ans = 1;
        int x = s;
        memo[x] = true;

        int y;

        while(true) {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        }

        System.out.println(ans);
    }


    public static void main(String args[]) {

        input();

        solve();
    }
} Main
import java.time.Year;
import java.util.*;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    // input
    static int s;

    /**
     * input
     */
    static void input(){
        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        sc.close();
    }
 

    static int f(int n) {
        if (n%2==0) {
            return n/2;
        } else {
            return 3*n+1;
        }
    }

    static boolean[] memo;

    /**
     * solver
     */
    static void solve(){
        memo = new boolean[1000000];

        int ans = 1;
        int x = s;
        memo[x] = true;

        int y;

        while(true) {
            y = f(x);
            ans ++;

            if (memo[y]) {
                break;
            } else {
                memo[y] = true;
                x = y;
            }
        }

        System.out.println(ans);
    }


    public static void main(String args[]) {

        input();

        solve();
    }
}
