
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        set.add(s);
        s = s % 2 == 0 ? s / 2: s * 3 + 1;
        while (!set.contains(s)) {
            set.add(s);
            s = s % 2 == 0 ? s / 2: s * 3 + 1;
        }
        System.out.println(set.size()+1);
	}

} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        set.add(s);
        s = s % 2 == 0 ? s / 2: s * 3 + 1;
        while (!set.contains(s)) {
            set.add(s);
            s = s % 2 == 0 ? s / 2: s * 3 + 1;
        }
        System.out.println(set.size()+1);
	}

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

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        set.add(s);
        s = s % 2 == 0 ? s / 2: s * 3 + 1;
        while (!set.contains(s)) {
            set.add(s);
            s = s % 2 == 0 ? s / 2: s * 3 + 1;
        }
        System.out.println(set.size()+1);
	}

} public class Main {

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        set.add(s);
        s = s % 2 == 0 ? s / 2: s * 3 + 1;
        while (!set.contains(s)) {
            set.add(s);
            s = s % 2 == 0 ? s / 2: s * 3 + 1;
        }
        System.out.println(set.size()+1);
	}

} Main

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        Set<Integer> set = new HashSet<>();
        set.add(s);
        s = s % 2 == 0 ? s / 2: s * 3 + 1;
        while (!set.contains(s)) {
            set.add(s);
            s = s % 2 == 0 ? s / 2: s * 3 + 1;
        }
        System.out.println(set.size()+1);
	}

}
