
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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