import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s =Integer.parseInt(sc.next());

        Map<Integer,Integer> map = new HashMap<>();
        int a = s;
        int idx = 1;
        while(a<=1000000){
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        }
        sc.close();
    }
} import java.util.HashMap; HashMap java.util import java.util.Map; Map 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 =Integer.parseInt(sc.next());

        Map<Integer,Integer> map = new HashMap<>();
        int a = s;
        int idx = 1;
        while(a<=1000000){
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        }
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s =Integer.parseInt(sc.next());

        Map<Integer,Integer> map = new HashMap<>();
        int a = s;
        int idx = 1;
        while(a<=1000000){
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        }
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int s =Integer.parseInt(sc.next());

        Map<Integer,Integer> map = new HashMap<>();
        int a = s;
        int idx = 1;
        while(a<=1000000){
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        }
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s =Integer.parseInt(sc.next()); s Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Map<Integer,Integer> map = new HashMap<>(); map new HashMap<>() int a = s; a s int idx = 1; idx 1 while(a<=1000000){
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        } a<=1000000 a 1000000 {
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        } if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            } !map.containsKey(a) map.containsKey(a) map.containsKey map a {
                map.put(a,idx);
            } map.put(a,idx) map.put map a idx {
                System.out.println(idx);
                return;
            } System.out.println(idx) System.out.println System.out System System.out idx return; idx++ idx 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 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 =Integer.parseInt(sc.next());

        Map<Integer,Integer> map = new HashMap<>();
        int a = s;
        int idx = 1;
        while(a<=1000000){
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        }
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s =Integer.parseInt(sc.next());

        Map<Integer,Integer> map = new HashMap<>();
        int a = s;
        int idx = 1;
        while(a<=1000000){
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        }
        sc.close();
    }
} Main
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s =Integer.parseInt(sc.next());

        Map<Integer,Integer> map = new HashMap<>();
        int a = s;
        int idx = 1;
        while(a<=1000000){
            if(!map.containsKey(a)){
                map.put(a,idx);
            }else{
                System.out.println(idx);
                return;
            }
            idx++;
            if(a%2==0){
                a/=2;
            }else{
                a = 3*a+1;
            }
        }
        sc.close();
    }
}