import java.util.HashSet;
import java.util.Set;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        int a = s;
        int index = 1;
        while (!set.contains(a)) {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        }
        System.out.println(index);
        sc.close();
    }
} import java.util.HashSet; HashSet java.util import java.util.Set; Set 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 s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        int a = s;
        int index = 1;
        while (!set.contains(a)) {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        }
        System.out.println(index);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        int a = s;
        int index = 1;
        while (!set.contains(a)) {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        }
        System.out.println(index);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        int a = s;
        int index = 1;
        while (!set.contains(a)) {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        }
        System.out.println(index);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Set<Integer> set = new HashSet<>(); set new HashSet<>() int a = s; a s int index = 1; index 1 while (!set.contains(a)) {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        } !set.contains(a) set.contains(a) set.contains set a {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        } set.add(a) set.add set a if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            } a % 2 == 0 a % 2 a 2 0 {
                a /= 2;
            } a /= 2 a 2 {
                a = 3 * a + 1;
            } a = 3 * a + 1 a 3 * a + 1 3 * a 3 a 1 index++ index System.out.println(index) System.out.println System.out System System.out index sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        int a = s;
        int index = 1;
        while (!set.contains(a)) {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        }
        System.out.println(index);
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        int a = s;
        int index = 1;
        while (!set.contains(a)) {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        }
        System.out.println(index);
        sc.close();
    }
} Main
import java.util.HashSet;
import java.util.Set;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        int a = s;
        int index = 1;
        while (!set.contains(a)) {
            set.add(a);
            if (a % 2 == 0) {
                a /= 2;
            } else {
                a = 3 * a + 1;
            }
            index++;
        }
        System.out.println(index);
        sc.close();
    }
}