import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		HashSet<Integer> set = new HashSet<>();
		set.add(s);
		for (int i = 2; i <= 1000000; i++) {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		}
	}
	
	static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return n * 3 + 1;
		}
	}
} import java.util.*; util.* java public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		HashSet<Integer> set = new HashSet<>();
		set.add(s);
		for (int i = 2; i <= 1000000; i++) {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		}
	}
	
	static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return n * 3 + 1;
		}
	}
} Main public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		HashSet<Integer> set = new HashSet<>();
		set.add(s);
		for (int i = 2; i <= 1000000; i++) {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		HashSet<Integer> set = new HashSet<>();
		set.add(s);
		for (int i = 2; i <= 1000000; i++) {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc HashSet<Integer> set = new HashSet<>(); set new HashSet<>() set.add(s) set.add set s for (int i = 2; i <= 1000000; i++) {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		} int i = 2; int i = 2; i 2 i <= 1000000 i 1000000 i++ i++ i {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		} {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		} s = func(s) s func(s) func s if (set.contains(s)) {
				System.out.println(i);
				break;
			} set.contains(s) set.contains set s {
				System.out.println(i);
				break;
			} System.out.println(i) System.out.println System.out System System.out i break; set.add(s) set.add set s String[] args args static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return n * 3 + 1;
		}
	} func {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return n * 3 + 1;
		}
	} if (n % 2 == 0) {
			return n / 2;
		} else {
			return n * 3 + 1;
		} n % 2 == 0 n % 2 n 2 0 {
			return n / 2;
		} return n / 2; n / 2 n 2 {
			return n * 3 + 1;
		} return n * 3 + 1; n * 3 + 1 n * 3 n 3 1 int n n public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		HashSet<Integer> set = new HashSet<>();
		set.add(s);
		for (int i = 2; i <= 1000000; i++) {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		}
	}
	
	static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return n * 3 + 1;
		}
	}
} public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		HashSet<Integer> set = new HashSet<>();
		set.add(s);
		for (int i = 2; i <= 1000000; i++) {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		}
	}
	
	static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return n * 3 + 1;
		}
	}
} Main
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		HashSet<Integer> set = new HashSet<>();
		set.add(s);
		for (int i = 2; i <= 1000000; i++) {
			s = func(s);
			if (set.contains(s)) {
				System.out.println(i);
				break;
			}
			set.add(s);
		}
	}
	
	static int func(int n) {
		if (n % 2 == 0) {
			return n / 2;
		} else {
			return n * 3 + 1;
		}
	}
}
