
import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        HashMap<Integer, Integer> m = new HashMap<>();
        m.put(s, 1);
        for (int i = 2;; i++) {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 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();
        HashMap<Integer, Integer> m = new HashMap<>();
        m.put(s, 1);
        for (int i = 2;; i++) {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        }
    }

} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        HashMap<Integer, Integer> m = new HashMap<>();
        m.put(s, 1);
        for (int i = 2;; i++) {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        HashMap<Integer, Integer> m = new HashMap<>();
        m.put(s, 1);
        for (int i = 2;; i++) {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc HashMap<Integer, Integer> m = new HashMap<>(); m new HashMap<>() m.put(s, 1) m.put m s 1 for (int i = 2;; i++) {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        } int i = 2; int i = 2; i 2 i++ i++ i {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        } {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        } if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1; s % 2 == 0 s % 2 s 2 0 s = s / 2 s s / 2 s 2 s = 3 * s + 1 s 3 * s + 1 3 * s 3 s 1 if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            } m.containsKey(s) m.containsKey m s {
                System.out.println(i);
                break;
            } System.out.println(i) System.out.println System.out System System.out i break; {
                m.put(s, 1);
            } m.put(s, 1) m.put m s 1 String args[] args public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        HashMap<Integer, Integer> m = new HashMap<>();
        m.put(s, 1);
        for (int i = 2;; i++) {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        }
    }

} public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        HashMap<Integer, Integer> m = new HashMap<>();
        m.put(s, 1);
        for (int i = 2;; i++) {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        }
    }

} Main

import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        HashMap<Integer, Integer> m = new HashMap<>();
        m.put(s, 1);
        for (int i = 2;; i++) {
            if (s % 2 == 0)
                s = s / 2;
            else
                s = 3 * s + 1;

            if (m.containsKey(s)) {
                System.out.println(i);
                break;
            } else {
                m.put(s, 1);
            }
        }
    }

}
