import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        Set<Integer> s = new HashSet<>();
        s.add(a);
        int idx = 1;
        while(true) {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        }
    }
}
 import java.util.*; util.* java public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        Set<Integer> s = new HashSet<>();
        s.add(a);
        int idx = 1;
        while(true) {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        }
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        Set<Integer> s = new HashSet<>();
        s.add(a);
        int idx = 1;
        while(true) {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        Set<Integer> s = new HashSet<>();
        s.add(a);
        int idx = 1;
        while(true) {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc Set<Integer> s = new HashSet<>(); s new HashSet<>() s.add(a) s.add s a int idx = 1; idx 1 while(true) {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        } true {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        } idx++ idx int t = a % 2 == 0 ? (a / 2) : (3 * a + 1); t a % 2 == 0 ? (a / 2) : (3 * a + 1) a % 2 == 0 a % 2 a 2 0 (a / 2) a 2 (3 * a + 1) 3 * a 3 a 1 if(s.contains(t)) {
                System.out.println(idx);
                break;
            } s.contains(t) s.contains s t {
                System.out.println(idx);
                break;
            } System.out.println(idx) System.out.println System.out System System.out idx break; s.add(t) s.add s t a = t a t String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        Set<Integer> s = new HashSet<>();
        s.add(a);
        int idx = 1;
        while(true) {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        }
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        Set<Integer> s = new HashSet<>();
        s.add(a);
        int idx = 1;
        while(true) {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        Set<Integer> s = new HashSet<>();
        s.add(a);
        int idx = 1;
        while(true) {
            idx++;
            int t = a % 2 == 0 ? (a / 2) : (3 * a + 1);
            if(s.contains(t)) {
                System.out.println(idx);
                break;
            } 
            s.add(t);
            a = t;
        }
    }
}

