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

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		}
	}

	/**
	 * f(n)を計算する
	 * 
	 * @param n
	 * @return f(n)
	 */
	private static int f(int n) {
		return (0 == (n & 1)) ? n / 2 : 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) {
		try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		}
	}

	/**
	 * f(n)を計算する
	 * 
	 * @param n
	 * @return f(n)
	 */
	private static int f(int n) {
		return (0 == (n & 1)) ? n / 2 : 3 * n + 1;
	}
} Main public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		}
	} main {
		try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		}
	} try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		} {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) int s = scanner.nextInt(); s scanner.nextInt() scanner.nextInt scanner Set<Integer> set = new HashSet<>(); set new HashSet<>() int now = s now s prev = -1 prev -1 1 count = 1; count 1 while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			} !set.contains(now) set.contains(now) set.contains set now {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			} set.add(now) set.add set now prev = now prev now now = f(prev) now f(prev) f prev count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args /**
	 * f(n)を計算する
	 * 
	 * @param n
	 * @return f(n)
	 */
	private static int f(int n) {
		return (0 == (n & 1)) ? n / 2 : 3 * n + 1;
	} f {
		return (0 == (n & 1)) ? n / 2 : 3 * n + 1;
	} return (0 == (n & 1)) ? n / 2 : 3 * n + 1; (0 == (n & 1)) ? n / 2 : 3 * n + 1 (0 == (n & 1)) 0 (n & 1) n 1 n / 2 n 2 3 * n + 1 3 * n 3 n 1 int n n public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		}
	}

	/**
	 * f(n)を計算する
	 * 
	 * @param n
	 * @return f(n)
	 */
	private static int f(int n) {
		return (0 == (n & 1)) ? n / 2 : 3 * n + 1;
	}
} public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		}
	}

	/**
	 * f(n)を計算する
	 * 
	 * @param n
	 * @return f(n)
	 */
	private static int f(int n) {
		return (0 == (n & 1)) ? n / 2 : 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) {
		try (Scanner scanner = new Scanner(System.in)) {
			int s = scanner.nextInt();
			Set<Integer> set = new HashSet<>();
			int now = s, prev = -1, count = 1;
			while (!set.contains(now)) {
				set.add(now);
				prev = now;
				now = f(prev);
				count++;
			}
			System.out.println(count);
		}
	}

	/**
	 * f(n)を計算する
	 * 
	 * @param n
	 * @return f(n)
	 */
	private static int f(int n) {
		return (0 == (n & 1)) ? n / 2 : 3 * n + 1;
	}
}
