import java.util.*;




public class Main {


    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int s = cin.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        map.put(s,1);
        for (int i = 2; true; i++) {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        }
    }


} import java.util.*; util.* java public class Main {


    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int s = cin.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        map.put(s,1);
        for (int i = 2; true; i++) {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        }
    }


} Main public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int s = cin.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        map.put(s,1);
        for (int i = 2; true; i++) {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        }
    } main {
        Scanner cin = new Scanner(System.in);
        int s = cin.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        map.put(s,1);
        for (int i = 2; true; i++) {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        }
    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int s = cin.nextInt(); s cin.nextInt() cin.nextInt cin Map<Integer, Integer> map = new HashMap<>(); map new HashMap<>() map.put(s,1) map.put map s 1 for (int i = 2; true; i++) {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        } int i = 2; int i = 2; i 2 true i++ i++ i {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        } {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        } int n = s; n s s = n%2==0? n/2 : 3*n+1 s n%2==0? n/2 : 3*n+1 n%2==0 n%2 n 2 0 n/2 n 2 3*n+1 3*n 3 n 1 if (map.get(s) != null) {
                System.out.println(i);
                break;
            } map.get(s) != null map.get(s) map.get map s null {
                System.out.println(i);
                break;
            } System.out.println(i) System.out.println System.out System System.out i break; map.put(s,1) map.put map s 1 String[] args args public class Main {


    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int s = cin.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        map.put(s,1);
        for (int i = 2; true; i++) {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        }
    }


} public class Main {


    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int s = cin.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        map.put(s,1);
        for (int i = 2; true; i++) {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        }
    }


} Main
import java.util.*;




public class Main {


    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int s = cin.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        map.put(s,1);
        for (int i = 2; true; i++) {
            int n = s;
            s = n%2==0? n/2 : 3*n+1;
            if (map.get(s) != null) {
                System.out.println(i);
                break;
            }
            map.put(s,1);
        }
    }


}
