import java.util.HashSet;
import java.util.Scanner;

public class Main{

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();
		
		HashSet<Integer> hs = new HashSet<>();
		int a1 = s;
		hs.add(s);
		int m = 1;
		boolean found = false;
		
		while(found == false) {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		}
		
	}
	
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();
		
		HashSet<Integer> hs = new HashSet<>();
		int a1 = s;
		hs.add(s);
		int m = 1;
		boolean found = false;
		
		while(found == false) {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		}
		
	}
	
} Main public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();
		
		HashSet<Integer> hs = new HashSet<>();
		int a1 = s;
		hs.add(s);
		int m = 1;
		boolean found = false;
		
		while(found == false) {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		}
		
	} main {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();
		
		HashSet<Integer> hs = new HashSet<>();
		int a1 = s;
		hs.add(s);
		int m = 1;
		boolean found = false;
		
		while(found == false) {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		}
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int s = scan.nextInt(); s scan.nextInt() scan.nextInt scan HashSet<Integer> hs = new HashSet<>(); hs new HashSet<>() int a1 = s; a1 s hs.add(s) hs.add hs s int m = 1; m 1 boolean found = false; found false while(found == false) {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		} found == false found false {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		} if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			} (a1 % 2 == 0) a1 % 2 a1 2 0 {
				a1 = a1 / 2;
			} a1 = a1 / 2 a1 a1 / 2 a1 2 {
				a1 = 3 * a1 + 1;
			} a1 = 3 * a1 + 1 a1 3 * a1 + 1 3 * a1 3 a1 1 m++ m if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			} hs.contains(a1) hs.contains hs a1 {
				System.out.println(m);
				found = true;
			} System.out.println(m) System.out.println System.out System System.out m found = true found true hs.add(a1) hs.add hs a1 String args[] args public class Main{

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();
		
		HashSet<Integer> hs = new HashSet<>();
		int a1 = s;
		hs.add(s);
		int m = 1;
		boolean found = false;
		
		while(found == false) {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		}
		
	}
	
} public class Main{

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();
		
		HashSet<Integer> hs = new HashSet<>();
		int a1 = s;
		hs.add(s);
		int m = 1;
		boolean found = false;
		
		while(found == false) {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		}
		
	}
	
} Main
import java.util.HashSet;
import java.util.Scanner;

public class Main{

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();
		
		HashSet<Integer> hs = new HashSet<>();
		int a1 = s;
		hs.add(s);
		int m = 1;
		boolean found = false;
		
		while(found == false) {
			if((a1 % 2 == 0)) {
				a1 = a1 / 2;
			}else {
				a1 = 3 * a1 + 1;
			}
			
			m++;
			
			if(hs.contains(a1)) {
				System.out.println(m);
				found = true;
			}
			
			hs.add(a1);
		}
		
	}
	
}