import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int ans = s;
        int m = 0;
        int n = 0;
        int cnt =1;

        list.add(s);

        while(true){
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        }

        System.out.println(m);


    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int ans = s;
        int m = 0;
        int n = 0;
        int cnt =1;

        list.add(s);

        while(true){
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        }

        System.out.println(m);


    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int ans = s;
        int m = 0;
        int n = 0;
        int cnt =1;

        list.add(s);

        while(true){
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        }

        System.out.println(m);


    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int ans = s;
        int m = 0;
        int n = 0;
        int cnt =1;

        list.add(s);

        while(true){
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        }

        System.out.println(m);


    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() int ans = s; ans s int m = 0; m 0 int n = 0; n 0 int cnt =1; cnt 1 list.add(s) list.add list s while(true){
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        } true {
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        } if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            } ans%2==0 ans%2 ans 2 0 {
                ans=ans/2;
            } ans=ans/2 ans ans/2 ans 2 {
                ans=ans*3+1;
            } ans=ans*3+1 ans ans*3+1 ans*3 ans 3 1 cnt++ cnt if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            } list.contains(ans) list.contains list ans {
               n = list.indexOf(ans);
               m = cnt;
               break;

            } n = list.indexOf(ans) n list.indexOf(ans) list.indexOf list ans m = cnt m cnt break; {
                list.add(ans);
            } list.add(ans) list.add list ans System.out.println(m) System.out.println System.out System System.out m String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int ans = s;
        int m = 0;
        int n = 0;
        int cnt =1;

        list.add(s);

        while(true){
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        }

        System.out.println(m);


    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int ans = s;
        int m = 0;
        int n = 0;
        int cnt =1;

        list.add(s);

        while(true){
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        }

        System.out.println(m);


    }
} Main
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        int ans = s;
        int m = 0;
        int n = 0;
        int cnt =1;

        list.add(s);

        while(true){
            if(ans%2==0){
                ans=ans/2;
            }else{
                ans=ans*3+1;
            }
            cnt++;

            if(list.contains(ans)){
               n = list.indexOf(ans);
               m = cnt;
               break;

            }else{
                list.add(ans);
            }

        }

        System.out.println(m);


    }
}
