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);
		
		int i = 1;
		while (true) {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		}
		
		System.out.println(i);
		
		sc.close();
	}
	
	static int f(int n) {
		if (n % 2 == 0) return n / 2;
		return 3 * n + 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);
		
		int i = 1;
		while (true) {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		}
		
		System.out.println(i);
		
		sc.close();
	}
	
	static int f(int n) {
		if (n % 2 == 0) return n / 2;
		return 3 * n + 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);
		
		int i = 1;
		while (true) {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		}
		
		System.out.println(i);
		
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		
		Set<Integer> set = new HashSet<>();
		set.add(s);
		
		int i = 1;
		while (true) {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		}
		
		System.out.println(i);
		
		sc.close();
	} 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 int i = 1; i 1 while (true) {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		} true {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		} i++ i s = f(s) s f(s) f s if (!set.add(s)) break; !set.add(s) set.add(s) set.add set s break; System.out.println(i) System.out.println System.out System System.out i sc.close() sc.close sc String[] args args static int f(int n) {
		if (n % 2 == 0) return n / 2;
		return 3 * n + 1;
	} f {
		if (n % 2 == 0) return n / 2;
		return 3 * n + 1;
	} if (n % 2 == 0) return n / 2; 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();
		
		Set<Integer> set = new HashSet<>();
		set.add(s);
		
		int i = 1;
		while (true) {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		}
		
		System.out.println(i);
		
		sc.close();
	}
	
	static int f(int n) {
		if (n % 2 == 0) return n / 2;
		return 3 * n + 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);
		
		int i = 1;
		while (true) {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		}
		
		System.out.println(i);
		
		sc.close();
	}
	
	static int f(int n) {
		if (n % 2 == 0) return n / 2;
		return 3 * n + 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);
		
		int i = 1;
		while (true) {
			i++;
			s = f(s);
			if (!set.add(s)) break;
		}
		
		System.out.println(i);
		
		sc.close();
	}
	
	static int f(int n) {
		if (n % 2 == 0) return n / 2;
		return 3 * n + 1;
	}
}


