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);
        while(true) {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        }
    }
} 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);
        while(true) {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        }
    }
} 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);
        while(true) {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(s);
        while(true) {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        }
    } 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 while(true) {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        } true {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        } if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1; s % 2 == 0 s % 2 s 2 0 s = s / 2 s s / 2 s 2 s = s * 3 + 1 s s * 3 + 1 s * 3 s 3 1 if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            } list.contains(s) list.contains list s {
                System.out.println(list.size() + 1);
                return;
            } System.out.println(list.size() + 1) System.out.println System.out System System.out list.size() + 1 list.size() list.size list 1 return; {
                list.add(s);
            } list.add(s) list.add list s 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);
        while(true) {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        }
    }
} 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);
        while(true) {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        }
    }
} 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);
        while(true) {
            if(s % 2 == 0) s = s / 2;
            else s = s * 3 + 1;
            if(list.contains(s)) {
                System.out.println(list.size() + 1);
                return;
            } else {
                list.add(s);
            }
        }
    }
}
