import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(S);
        int num = S;
        while(true) {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        }
        System.out.println(list.size()+1);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List 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 = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(S);
        int num = S;
        while(true) {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        }
        System.out.println(list.size()+1);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(S);
        int num = S;
        while(true) {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        }
        System.out.println(list.size()+1);
    } main {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(S);
        int num = S;
        while(true) {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        }
        System.out.println(list.size()+1);
    } 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<>() list.add(S) list.add list S int num = S; num S while(true) {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        } true {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        } if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            } num%2 == 0 num%2 num 2 0 {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } num = num/2 num num/2 num 2 if (list.contains(num))  break; list.contains(num) list.contains list num break; list.add(num) list.add list num {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            } num = num*3+1 num num*3+1 num*3 num 3 1 if (list.contains(num))  break; list.contains(num) list.contains list num break; list.add(num) list.add list num System.out.println(list.size()+1) System.out.println System.out System System.out list.size()+1 list.size() list.size list 1 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<>();
        list.add(S);
        int num = S;
        while(true) {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        }
        System.out.println(list.size()+1);
    }
} public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(S);
        int num = S;
        while(true) {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        }
        System.out.println(list.size()+1);
    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(S);
        int num = S;
        while(true) {
            if (num%2 == 0) {
                num = num/2;
                if (list.contains(num))  break;
                list.add(num);
            } else {
                num = num*3+1;
                if (list.contains(num))  break;
                list.add(num);
            }
        }
        System.out.println(list.size()+1);
    }
}