import java.awt.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        list.add(a);
        for (int i = 1;; i++) {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       }

    }
} import java.awt.List; List java.awt import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        list.add(a);
        for (int i = 1;; i++) {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       }

    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        list.add(a);
        for (int i = 1;; i++) {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       }

    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        list.add(a);
        for (int i = 1;; i++) {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc ArrayList<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(a) list.add list a for (int i = 1;; i++) {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       } int i = 1; int i = 1; i 1 i++ i++ i {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       } {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       } int x = list.get(i - 1); x list.get(i - 1) list.get list i - 1 i 1 if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            } x % 2 == 0 x % 2 x 2 0 {
                x = x / 2;
            } x = x / 2 x x / 2 x 2 {
                x = 3 * x + 1;
            } x = 3 * x + 1 x 3 * x + 1 3 * x 3 x 1 if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            } list.contains(x) list.contains list x {
                System.out.println(i + 1);
                break;
            } System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 break; list.add(x) list.add list x String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        list.add(a);
        for (int i = 1;; i++) {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       }

    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        list.add(a);
        for (int i = 1;; i++) {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       }

    }
} Main
import java.awt.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> list = new ArrayList<>();
        list.add(a);
        for (int i = 1;; i++) {
            int x = list.get(i - 1);
            if(x % 2 == 0){
                x = x / 2;
            } else {
                x = 3 * x + 1;
            }
            if (list.contains(x)) {
                System.out.println(i + 1);
                break;
            }
            list.add(x);
       }

    }
}
