import java.util.*;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int prevA = s;
 
		Set<Integer> prevFValues = new HashSet<>();
		prevFValues.add(s);
		for (int i=2; i<=1000000; i++) {
			int newA = f(prevA);
			if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            }
			prevFValues.add(newA);
			prevA = newA;
		}
	}

	static int f(int n) {
		return (n % 2 == 0) ? (n / 2) : (3 * n + 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();
		int prevA = s;
 
		Set<Integer> prevFValues = new HashSet<>();
		prevFValues.add(s);
		for (int i=2; i<=1000000; i++) {
			int newA = f(prevA);
			if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            }
			prevFValues.add(newA);
			prevA = newA;
		}
	}

	static int f(int n) {
		return (n % 2 == 0) ? (n / 2) : (3 * n + 1);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int prevA = s;
 
		Set<Integer> prevFValues = new HashSet<>();
		prevFValues.add(s);
		for (int i=2; i<=1000000; i++) {
			int newA = f(prevA);
			if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            }
			prevFValues.add(newA);
			prevA = newA;
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int prevA = s;
 
		Set<Integer> prevFValues = new HashSet<>();
		prevFValues.add(s);
		for (int i=2; i<=1000000; i++) {
			int newA = f(prevA);
			if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            }
			prevFValues.add(newA);
			prevA = newA;
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int prevA = s; prevA s Set<Integer> prevFValues = new HashSet<>(); prevFValues new HashSet<>() prevFValues.add(s) prevFValues.add prevFValues s for (int i=2; i<=1000000; i++) {
			int newA = f(prevA);
			if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            }
			prevFValues.add(newA);
			prevA = newA;
		} int i=2; int i=2; i 2 i<=1000000 i 1000000 i++ i++ i {
			int newA = f(prevA);
			if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            }
			prevFValues.add(newA);
			prevA = newA;
		} {
			int newA = f(prevA);
			if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            }
			prevFValues.add(newA);
			prevA = newA;
		} int newA = f(prevA); newA f(prevA) f prevA if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            } prevFValues.contains(newA) prevFValues.contains prevFValues newA {
				System.out.println(i);
				return;
            } System.out.println(i) System.out.println System.out System System.out i return; prevFValues.add(newA) prevFValues.add prevFValues newA prevA = newA prevA newA String[] args args static int f(int n) {
		return (n % 2 == 0) ? (n / 2) : (3 * n + 1);
	} f {
		return (n % 2 == 0) ? (n / 2) : (3 * n + 1);
	} return (n % 2 == 0) ? (n / 2) : (3 * n + 1); (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 int n n public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int prevA = s;
 
		Set<Integer> prevFValues = new HashSet<>();
		prevFValues.add(s);
		for (int i=2; i<=1000000; i++) {
			int newA = f(prevA);
			if (prevFValues.contains(newA)) {
				System.out.println(i);
				return;
            }
			prevFValues.add(newA);
			prevA = newA;
		}
	}

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

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

	static int f(int n) {
		return (n % 2 == 0) ? (n / 2) : (3 * n + 1);
	}
}
