
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		boolean count = true;
		ArrayList<Integer> a = new ArrayList<>();
		a.add(s);
		int i = 1;

		while (count) {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		}

		sc.close();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		boolean count = true;
		ArrayList<Integer> a = new ArrayList<>();
		a.add(s);
		int i = 1;

		while (count) {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		}

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		boolean count = true;
		ArrayList<Integer> a = new ArrayList<>();
		a.add(s);
		int i = 1;

		while (count) {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		}

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		boolean count = true;
		ArrayList<Integer> a = new ArrayList<>();
		a.add(s);
		int i = 1;

		while (count) {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		}

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc boolean count = true; count true ArrayList<Integer> a = new ArrayList<>(); a new ArrayList<>() a.add(s) a.add a s int i = 1; i 1 while (count) {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		} count {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		} i++ i if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			} s % 2 == 0 s % 2 s 2 0 {
				s /= 2;
			} s /= 2 s 2 {
				s = s * 3 + 1;
			} s = s * 3 + 1 s s * 3 + 1 s * 3 s 3 1 if (a.contains(s)) {
				System.out.println(i);
				break;
			} a.contains(s) a.contains a s {
				System.out.println(i);
				break;
			} System.out.println(i) System.out.println System.out System System.out i break; a.add(s) a.add a s sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		boolean count = true;
		ArrayList<Integer> a = new ArrayList<>();
		a.add(s);
		int i = 1;

		while (count) {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		}

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		boolean count = true;
		ArrayList<Integer> a = new ArrayList<>();
		a.add(s);
		int i = 1;

		while (count) {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		}

		sc.close();
	}
} Main

import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		boolean count = true;
		ArrayList<Integer> a = new ArrayList<>();
		a.add(s);
		int i = 1;

		while (count) {
			i++;
			if (s % 2 == 0) {
				s /= 2;
			} else {
				s = s * 3 + 1;
			}
			if (a.contains(s)) {
				System.out.println(i);
				break;
			}
			a.add(s);
		}

		sc.close();
	}
}
