import java.util.*;
public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			List<Integer> list = new ArrayList<>();
			list.add(n);
			sc.close();
			while(true) {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			}	
			int res = list.size()+1;
			System.out.println(res);
	}
		
	
	public static void main(String[] args) {
		solve();

	}

} import java.util.*; util.* java public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			List<Integer> list = new ArrayList<>();
			list.add(n);
			sc.close();
			while(true) {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			}	
			int res = list.size()+1;
			System.out.println(res);
	}
		
	
	public static void main(String[] args) {
		solve();

	}

} Main static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			List<Integer> list = new ArrayList<>();
			list.add(n);
			sc.close();
			while(true) {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			}	
			int res = list.size()+1;
			System.out.println(res);
	} solve {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			List<Integer> list = new ArrayList<>();
			list.add(n);
			sc.close();
			while(true) {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			}	
			int res = list.size()+1;
			System.out.println(res);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(n) list.add list n sc.close() sc.close sc while(true) {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			} true {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			} if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			} n%2==1 n%2 n 2 1 {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			} n = n*3+1 n n*3+1 n*3 n 3 1 if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				} list.contains(n) list.contains list n {
					break;
				} break; {
					list.add(n);
				} list.add(n) list.add list n {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			} n= n/2 n n/2 n 2 if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				} list.contains(n) list.contains list n {
					break;
				} break; {
				list.add(n);
				} list.add(n) list.add list n int res = list.size()+1; res list.size()+1 list.size() list.size list 1 System.out.println(res) System.out.println System.out System System.out res public static void main(String[] args) {
		solve();

	} main {
		solve();

	} solve() solve String[] args args public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			List<Integer> list = new ArrayList<>();
			list.add(n);
			sc.close();
			while(true) {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			}	
			int res = list.size()+1;
			System.out.println(res);
	}
		
	
	public static void main(String[] args) {
		solve();

	}

} public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			List<Integer> list = new ArrayList<>();
			list.add(n);
			sc.close();
			while(true) {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			}	
			int res = list.size()+1;
			System.out.println(res);
	}
		
	
	public static void main(String[] args) {
		solve();

	}

} Main
import java.util.*;
public class Main {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			List<Integer> list = new ArrayList<>();
			list.add(n);
			sc.close();
			while(true) {
			if(n%2==1) {
				n = n*3+1;
				if(list.contains(n)) {
					break;
				}
				else {
					list.add(n);
				}
			}
			else {
				n= n/2;
				if(list.contains(n)) {
					break;
				}
				else {
				list.add(n);
				}
			}
			}	
			int res = list.size()+1;
			System.out.println(res);
	}
		
	
	public static void main(String[] args) {
		solve();

	}

}