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

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int s = Integer.parseInt(sc.next());
        
        Set<Integer> set = new HashSet();
        
        int count = 1;
        set.add(s);
        while(true){
            count++;
            if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }
        }
        
        System.out.println(count);
    }
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int s = Integer.parseInt(sc.next());
        
        Set<Integer> set = new HashSet();
        
        int count = 1;
        set.add(s);
        while(true){
            count++;
            if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }
        }
        
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int s = Integer.parseInt(sc.next());
        
        Set<Integer> set = new HashSet();
        
        int count = 1;
        set.add(s);
        while(true){
            count++;
            if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }
        }
        
        System.out.println(count);
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int s = Integer.parseInt(sc.next());
        
        Set<Integer> set = new HashSet();
        
        int count = 1;
        set.add(s);
        while(true){
            count++;
            if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }
        }
        
        System.out.println(count);
    } 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 Set<Integer> set = new HashSet(); set new HashSet() int count = 1; count 1 set.add(s) set.add set s while(true){
            count++;
            if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }
        } true {
            count++;
            if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }
        } count++ count if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            } s%2 == 0 s%2 s 2 0 {
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            } s = s/2 s s/2 s 2 if(set.contains(s)){
                    break;
                } set.contains(s) set.contains set s {
                    break;
                } break; set.add(s) set.add set s {
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            } s = s*3+1 s s*3+1 s*3 s 3 1 if(set.contains(s)){
                    break;
                } set.contains(s) set.contains set s {
                    break;
                } break; set.add(s) set.add set s System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

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

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int s = Integer.parseInt(sc.next());
        
        Set<Integer> set = new HashSet();
        
        int count = 1;
        set.add(s);
        while(true){
            count++;
            if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }
        }
        
        System.out.println(count);
    }
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int s = Integer.parseInt(sc.next());
        
        Set<Integer> set = new HashSet();
        
        int count = 1;
        set.add(s);
        while(true){
            count++;
            if(s%2 == 0){
                s = s/2;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }else{
                s = s*3+1;
                if(set.contains(s)){
                    break;
                }
                set.add(s);
            }
        }
        
        System.out.println(count);
    }
}