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 N=sc.nextInt();
        sc.close();
        System.out.println(collatz(N));
    }

    private static int collatz(int x) {
        List<Integer> list = new ArrayList<>();
        int n = x;
        while(true) {
            list.add(n);
            int num = 0;
            if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            }
            if(list.contains(num)) {
                return list.size() + 1;
            }

            n = num;
        }
    }

}
 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 N=sc.nextInt();
        sc.close();
        System.out.println(collatz(N));
    }

    private static int collatz(int x) {
        List<Integer> list = new ArrayList<>();
        int n = x;
        while(true) {
            list.add(n);
            int num = 0;
            if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            }
            if(list.contains(num)) {
                return list.size() + 1;
            }

            n = num;
        }
    }

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

            n = num;
        }
    } collatz {
        List<Integer> list = new ArrayList<>();
        int n = x;
        while(true) {
            list.add(n);
            int num = 0;
            if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            }
            if(list.contains(num)) {
                return list.size() + 1;
            }

            n = num;
        }
    } List<Integer> list = new ArrayList<>(); list new ArrayList<>() int n = x; n x while(true) {
            list.add(n);
            int num = 0;
            if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            }
            if(list.contains(num)) {
                return list.size() + 1;
            }

            n = num;
        } true {
            list.add(n);
            int num = 0;
            if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            }
            if(list.contains(num)) {
                return list.size() + 1;
            }

            n = num;
        } list.add(n) list.add list n int num = 0; num 0 if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            } n%2 == 0 n%2 n 2 0 {
                num= n/2;
            } num= n/2 num n/2 n 2 {
                num = 3 * n + 1;
            } num = 3 * n + 1 num 3 * n + 1 3 * n 3 n 1 if(list.contains(num)) {
                return list.size() + 1;
            } list.contains(num) list.contains list num {
                return list.size() + 1;
            } return list.size() + 1; list.size() + 1 list.size() list.size list 1 n = num n num int x x public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        sc.close();
        System.out.println(collatz(N));
    }

    private static int collatz(int x) {
        List<Integer> list = new ArrayList<>();
        int n = x;
        while(true) {
            list.add(n);
            int num = 0;
            if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            }
            if(list.contains(num)) {
                return list.size() + 1;
            }

            n = num;
        }
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        sc.close();
        System.out.println(collatz(N));
    }

    private static int collatz(int x) {
        List<Integer> list = new ArrayList<>();
        int n = x;
        while(true) {
            list.add(n);
            int num = 0;
            if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            }
            if(list.contains(num)) {
                return list.size() + 1;
            }

            n = num;
        }
    }

} 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 N=sc.nextInt();
        sc.close();
        System.out.println(collatz(N));
    }

    private static int collatz(int x) {
        List<Integer> list = new ArrayList<>();
        int n = x;
        while(true) {
            list.add(n);
            int num = 0;
            if(n%2 == 0) {
                num= n/2;
            } else {
                num = 3 * n + 1;
            }
            if(list.contains(num)) {
                return list.size() + 1;
            }

            n = num;
        }
    }

}

