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 n = function(s);
        
        for (int i = 1; !list.contains(n); i++) {
            list.add(n);
            n = function(n);
        }
        System.out.println(list.size() + 1);
    }

    private static int function(int n) {
        if (n % 2 == 0) return n / 2;
        else return 3 * n + 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 n = function(s);
        
        for (int i = 1; !list.contains(n); i++) {
            list.add(n);
            n = function(n);
        }
        System.out.println(list.size() + 1);
    }

    private static int function(int n) {
        if (n % 2 == 0) return n / 2;
        else return 3 * n + 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 n = function(s);
        
        for (int i = 1; !list.contains(n); i++) {
            list.add(n);
            n = function(n);
        }
        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 n = function(s);
        
        for (int i = 1; !list.contains(n); i++) {
            list.add(n);
            n = function(n);
        }
        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 n = function(s); n function(s) function s for (int i = 1; !list.contains(n); i++) {
            list.add(n);
            n = function(n);
        } int i = 1; int i = 1; i 1 !list.contains(n) list.contains(n) list.contains list n i++ i++ i {
            list.add(n);
            n = function(n);
        } {
            list.add(n);
            n = function(n);
        } list.add(n) list.add list n n = function(n) n function(n) function n 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 private static int function(int n) {
        if (n % 2 == 0) return n / 2;
        else return 3 * n + 1;
    } function {
        if (n % 2 == 0) return n / 2;
        else return 3 * n + 1;
    } if (n % 2 == 0) return n / 2;
        else return 3 * n + 1; n % 2 == 0 n % 2 n 2 0 return n / 2; n / 2 n 2 return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n 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 n = function(s);
        
        for (int i = 1; !list.contains(n); i++) {
            list.add(n);
            n = function(n);
        }
        System.out.println(list.size() + 1);
    }

    private static int function(int n) {
        if (n % 2 == 0) return n / 2;
        else return 3 * n + 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 n = function(s);
        
        for (int i = 1; !list.contains(n); i++) {
            list.add(n);
            n = function(n);
        }
        System.out.println(list.size() + 1);
    }

    private static int function(int n) {
        if (n % 2 == 0) return n / 2;
        else return 3 * n + 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 n = function(s);
        
        for (int i = 1; !list.contains(n); i++) {
            list.add(n);
            n = function(n);
        }
        System.out.println(list.size() + 1);
    }

    private static int function(int n) {
        if (n % 2 == 0) return n / 2;
        else return 3 * n + 1;
    }
}