import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		Map<Integer,Integer> a = new HashMap<Integer,Integer>();
		int count = 1;

		a.put(s,0);

		while(true) {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		}
	}

} import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		Map<Integer,Integer> a = new HashMap<Integer,Integer>();
		int count = 1;

		a.put(s,0);

		while(true) {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		Map<Integer,Integer> a = new HashMap<Integer,Integer>();
		int count = 1;

		a.put(s,0);

		while(true) {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		Map<Integer,Integer> a = new HashMap<Integer,Integer>();
		int count = 1;

		a.put(s,0);

		while(true) {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Map<Integer,Integer> a = new HashMap<Integer,Integer>(); a new HashMap<Integer,Integer>() int count = 1; count 1 a.put(s,0) a.put a s 0 while(true) {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		} true {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		} count++ count if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			} s%2==0 s%2 s 2 0 {
				s = s/2;
			} s = s/2 s s/2 s 2 {
				s = s*3+1;
			} s = s*3+1 s s*3+1 s*3 s 3 1 if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			} a.containsKey(s) a.containsKey a s {
				System.out.println(count);
				break;
			} System.out.println(count) System.out.println System.out System System.out count break; {
				a.put(s,0);
			} a.put(s,0) a.put a s 0 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		Map<Integer,Integer> a = new HashMap<Integer,Integer>();
		int count = 1;

		a.put(s,0);

		while(true) {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		Map<Integer,Integer> a = new HashMap<Integer,Integer>();
		int count = 1;

		a.put(s,0);

		while(true) {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		}
	}

} Main
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		Map<Integer,Integer> a = new HashMap<Integer,Integer>();
		int count = 1;

		a.put(s,0);

		while(true) {
			count++;
			if(s%2==0) {
				s = s/2;
			}
			else {
				s = s*3+1;
			}
			if(a.containsKey(s)) {
				System.out.println(count);
				break;
			}
			else {
				a.put(s,0);
			}
		}
	}

}