import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    //final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    int s = sc.nextInt();
    int count = 1;
    int n = s;
    int check = 0;
    list.add(s);
    for(int i = 1 ; i < 50000 ; i++){
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    }

    //System.out.println(list);
    System.out.println(count);
    

    

    




    







}
} import java.io.BufferedReader; BufferedReader java.io import java.io.*; io.* java import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Collections; Collections java.util import java.util.Arrays; Arrays java.util public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    //final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    int s = sc.nextInt();
    int count = 1;
    int n = s;
    int check = 0;
    list.add(s);
    for(int i = 1 ; i < 50000 ; i++){
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    }

    //System.out.println(list);
    System.out.println(count);
    

    

    




    







}
} Main public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    //final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    int s = sc.nextInt();
    int count = 1;
    int n = s;
    int check = 0;
    list.add(s);
    for(int i = 1 ; i < 50000 ; i++){
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    }

    //System.out.println(list);
    System.out.println(count);
    

    

    




    







} main {
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    //final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    int s = sc.nextInt();
    int count = 1;
    int n = s;
    int check = 0;
    list.add(s);
    for(int i = 1 ; i < 50000 ; i++){
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    }

    //System.out.println(list);
    System.out.println(count);
    

    

    




    







} final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final List<Integer> list = new ArrayList<>(); list new ArrayList<>() int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int count = 1; count 1 int n = s; n s int check = 0; check 0 list.add(s) list.add list s for(int i = 1 ; i < 50000 ; i++){
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    } int i = 1 ; int i = 1 ; i 1 i < 50000 i 50000 i++ i++ i {
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    } {
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    } if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        } n % 2 == 0 n % 2 n 2 0 {
            n = n / 2;
            list.add(n);
        } n = n / 2 n n / 2 n 2 list.add(n) list.add list n {
            n = n*3 + 1;
            list.add(n);
        } n = n*3 + 1 n n*3 + 1 n*3 n 3 1 list.add(n) list.add list n count++ count Collections.sort(list) Collections.sort Collections list for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        } int j = 0 ; int j = 0 ; j 0 j < list.size() - 1 j list.size() - 1 list.size() list.size list 1 j++ j++ j {
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        } {
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        } if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            } list.get(j).equals(list.get(j+1)) list.get(j).equals list.get(j) list.get list j list.get(j+1) list.get list j+1 j 1 {
                check = 1;
                break;
            } check = 1 check 1 break; if(check == 1){
            break;
        } check == 1 check 1 {
            break;
        } break; System.out.println(count) System.out.println System.out System System.out count final String[] args args public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    //final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    int s = sc.nextInt();
    int count = 1;
    int n = s;
    int check = 0;
    list.add(s);
    for(int i = 1 ; i < 50000 ; i++){
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    }

    //System.out.println(list);
    System.out.println(count);
    

    

    




    







}
} public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    //final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    int s = sc.nextInt();
    int count = 1;
    int n = s;
    int check = 0;
    list.add(s);
    for(int i = 1 ; i < 50000 ; i++){
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    }

    //System.out.println(list);
    System.out.println(count);
    

    

    




    







}
} Main
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();
    //final List<Integer> list2 = new ArrayList<>();
    //final List<Long> list3 = new ArrayList<>();

    int s = sc.nextInt();
    int count = 1;
    int n = s;
    int check = 0;
    list.add(s);
    for(int i = 1 ; i < 50000 ; i++){
        if(n % 2 == 0){
            n = n / 2;
            list.add(n);
        }else{
            n = n*3 + 1;
            list.add(n);
        }
        count++;
        Collections.sort(list);
        for(int j = 0 ; j < list.size() - 1; j++){
            if(list.get(j).equals(list.get(j+1))){
                check = 1;
                break;
            }

        }
        if(check == 1){
            break;
        }
    }

    //System.out.println(list);
    System.out.println(count);
    

    

    




    







}
}