import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int s = sc.nextInt();

		Set<Integer> hs = new HashSet<>();
		hs.add(s);
		for (int i = 2, prev = s; true; i++) {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int s = sc.nextInt();

		Set<Integer> hs = new HashSet<>();
		hs.add(s);
		for (int i = 2, prev = s; true; i++) {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main private static Scanner sc; sc private static Printer pr; pr private static void solve() {
		int s = sc.nextInt();

		Set<Integer> hs = new HashSet<>();
		hs.add(s);
		for (int i = 2, prev = s; true; i++) {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		}
	} solve {
		int s = sc.nextInt();

		Set<Integer> hs = new HashSet<>();
		hs.add(s);
		for (int i = 2, prev = s; true; i++) {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		}
	} int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Set<Integer> hs = new HashSet<>(); hs new HashSet<>() hs.add(s) hs.add hs s for (int i = 2, prev = s; true; i++) {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		} int i = 2, prev = s; int i = 2 i 2 prev = s; prev s true i++ i++ i {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		} {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		} int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1; a prev % 2 == 0 ? prev / 2 : 3 * prev + 1 prev % 2 == 0 prev % 2 prev 2 0 prev / 2 prev 2 3 * prev + 1 3 * prev 3 prev 1 if (!hs.add(a)) {
				pr.println(i);
				break;
			} !hs.add(a) hs.add(a) hs.add hs a {
				pr.println(i);
				break;
			} pr.println(i) pr.println pr i break; prev = a prev a // ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	} main {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	} sc = new Scanner(System.in) sc new Scanner(System.in) pr = new Printer(System.out) pr new Printer(System.out) solve() solve pr.close() pr.close pr sc.close() sc.close sc String[] args args static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	} Printer Printer(OutputStream out) {
			super(out);
		} Printer {
			super(out);
		} super(out) super out OutputStream out out PrintWriter public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int s = sc.nextInt();

		Set<Integer> hs = new HashSet<>();
		hs.add(s);
		for (int i = 2, prev = s; true; i++) {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int s = sc.nextInt();

		Set<Integer> hs = new HashSet<>();
		hs.add(s);
		for (int i = 2, prev = s; true; i++) {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
} Main
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int s = sc.nextInt();

		Set<Integer> hs = new HashSet<>();
		hs.add(s);
		for (int i = 2, prev = s; true; i++) {
			int a = prev % 2 == 0 ? prev / 2 : 3 * prev + 1;
			if (!hs.add(a)) {
				pr.println(i);
				break;
			}
			
			prev = a;
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);
			
		solve();
			
		pr.close();
		sc.close();
	}

	static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}
