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

// 19
public class Main {
    static int func(int n) {
        if(n % 2 == 0) return n / 2;
        return 3 * n + 1;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Set<Integer> set = new HashSet<Integer>();
        int i = 1;
        while(true) {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        }

        System.out.println(i + 1);
    }

} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
    static int func(int n) {
        if(n % 2 == 0) return n / 2;
        return 3 * n + 1;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Set<Integer> set = new HashSet<Integer>();
        int i = 1;
        while(true) {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        }

        System.out.println(i + 1);
    }

} Main static int func(int n) {
        if(n % 2 == 0) return n / 2;
        return 3 * n + 1;
    } func {
        if(n % 2 == 0) return n / 2;
        return 3 * n + 1;
    } if(n % 2 == 0) return n / 2; n % 2 == 0 n % 2 n 2 0 return n / 2; n / 2 n 2 return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Set<Integer> set = new HashSet<Integer>();
        int i = 1;
        while(true) {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        }

        System.out.println(i + 1);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Set<Integer> set = new HashSet<Integer>();
        int i = 1;
        while(true) {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        }

        System.out.println(i + 1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Set<Integer> set = new HashSet<Integer>(); set new HashSet<Integer>() int i = 1; i 1 while(true) {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        } true {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        } set.add(n) set.add set n n = func(n) n func(n) func n if(set.contains(n))
                break; set.contains(n) set.contains set n break; ++i i System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 String[] args args public class Main {
    static int func(int n) {
        if(n % 2 == 0) return n / 2;
        return 3 * n + 1;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Set<Integer> set = new HashSet<Integer>();
        int i = 1;
        while(true) {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        }

        System.out.println(i + 1);
    }

} public class Main {
    static int func(int n) {
        if(n % 2 == 0) return n / 2;
        return 3 * n + 1;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Set<Integer> set = new HashSet<Integer>();
        int i = 1;
        while(true) {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        }

        System.out.println(i + 1);
    }

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

// 19
public class Main {
    static int func(int n) {
        if(n % 2 == 0) return n / 2;
        return 3 * n + 1;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Set<Integer> set = new HashSet<Integer>();
        int i = 1;
        while(true) {
            set.add(n);
            n = func(n);
            if(set.contains(n))
                break;
            ++i;
        }

        System.out.println(i + 1);
    }

}
