import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;

public class Main{



	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] tmp = scanner.nextLine().split(" ");
		int n        = Integer.parseInt(tmp[0]);
		int count    = 1;
		Set<Integer> set = new HashSet<>();

		for(;;) {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		}

		System.out.println(count);

	}
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main{



	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] tmp = scanner.nextLine().split(" ");
		int n        = Integer.parseInt(tmp[0]);
		int count    = 1;
		Set<Integer> set = new HashSet<>();

		for(;;) {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		}

		System.out.println(count);

	}
} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] tmp = scanner.nextLine().split(" ");
		int n        = Integer.parseInt(tmp[0]);
		int count    = 1;
		Set<Integer> set = new HashSet<>();

		for(;;) {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		}

		System.out.println(count);

	} main {

		Scanner scanner = new Scanner(System.in);

		String[] tmp = scanner.nextLine().split(" ");
		int n        = Integer.parseInt(tmp[0]);
		int count    = 1;
		Set<Integer> set = new HashSet<>();

		for(;;) {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		}

		System.out.println(count);

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] tmp = scanner.nextLine().split(" "); tmp scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " int n        = Integer.parseInt(tmp[0]); n Integer.parseInt(tmp[0]) Integer.parseInt Integer tmp[0] tmp 0 int count    = 1; count 1 Set<Integer> set = new HashSet<>(); set new HashSet<>() for(;;) {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		} ; {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		} {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		} set.add(n) set.add set n if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			} n % 2 == 0 n % 2 n 2 0 {
				n /= 2;
			} n /= 2 n 2 {
				n  = 3 * n + 1;

			} n  = 3 * n + 1 n 3 * n + 1 3 * n 3 n 1 count++ count if(set.contains(n)) {
				break;
			} set.contains(n) set.contains set n {
				break;
			} break; System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{



	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] tmp = scanner.nextLine().split(" ");
		int n        = Integer.parseInt(tmp[0]);
		int count    = 1;
		Set<Integer> set = new HashSet<>();

		for(;;) {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		}

		System.out.println(count);

	}
} public class Main{



	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] tmp = scanner.nextLine().split(" ");
		int n        = Integer.parseInt(tmp[0]);
		int count    = 1;
		Set<Integer> set = new HashSet<>();

		for(;;) {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		}

		System.out.println(count);

	}
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.Set;

public class Main{



	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		String[] tmp = scanner.nextLine().split(" ");
		int n        = Integer.parseInt(tmp[0]);
		int count    = 1;
		Set<Integer> set = new HashSet<>();

		for(;;) {

			set.add(n);
			if(n % 2 == 0) {
				n /= 2;
			}else {
				n  = 3 * n + 1;

			}

			count++;
			if(set.contains(n)) {
				break;
			}

		}

		System.out.println(count);

	}
}