import java.util.*;

public class Main {
	
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		
		HashMap<Integer, Boolean> record = new HashMap<Integer, Boolean>();
		record.put(s, true);
		int count = 1;
		while(true) {
			s = f(s);
			count++;
			if (record.containsKey(s)) {
				System.out.println(count);
				break;
			}
			record.put(s, true);
		}
	}
	
	public static int f(int n) {
		if (n%2 == 0) {
			return n/2;
		}
		return 3*n+1;
	}
} import java.util.*; util.* java public class Main {
	
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		
		HashMap<Integer, Boolean> record = new HashMap<Integer, Boolean>();
		record.put(s, true);
		int count = 1;
		while(true) {
			s = f(s);
			count++;
			if (record.containsKey(s)) {
				System.out.println(count);
				break;
			}
			record.put(s, true);
		}
	}
	
	public static int f(int n) {
		if (n%2 == 0) {
			return n/2;
		}
		return 3*n+1;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		
		HashMap<Integer, Boolean> record = new HashMap<Integer, Boolean>();
		record.put(s, true);
		int count = 1;
		while(true) {
			s = f(s);
			count++;
			if (record.containsKey(s)) {
				System.out.println(count);
				break;
			}
			record.put(s, true);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		
		HashMap<Integer, Boolean> record = new HashMap<Integer, Boolean>();
		record.put(s, true);
		int count = 1;
		while(true) {
			s = f(s);
			count++;
			if (record.containsKey(s)) {
				System.out.println(count);
				break;
			}
			record.put(s, true);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc HashMap<Integer, Boolean> record = new HashMap<Integer, Boolean>(); record new HashMap<Integer, Boolean>() record.put(s, true) record.put record s true int count = 1; count 1 while(true) {
			s = f(s);
			count++;
			if (record.containsKey(s)) {
				System.out.println(count);
				break;
			}
			record.put(s, true);
		} true {
			s = f(s);
			count++;
			if (record.containsKey(s)) {
				System.out.println(count);
				break;
			}
			record.put(s, true);
		} s = f(s) s f(s) f s count++ count if (record.containsKey(s)) {
				System.out.println(count);
				break;
			} record.containsKey(s) record.containsKey record s {
				System.out.println(count);
				break;
			} System.out.println(count) System.out.println System.out System System.out count break; record.put(s, true) record.put record s true String[] args args public static int f(int n) {
		if (n%2 == 0) {
			return n/2;
		}
		return 3*n+1;
	} f {
		if (n%2 == 0) {
			return n/2;
		}
		return 3*n+1;
	} if (n%2 == 0) {
			return n/2;
		} n%2 == 0 n%2 n 2 0 {
			return n/2;
		} return n/2; n/2 n 2 return 3*n+1; 3*n+1 3*n 3 n 1 int n n public class Main {
	
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		
		HashMap<Integer, Boolean> record = new HashMap<Integer, Boolean>();
		record.put(s, true);
		int count = 1;
		while(true) {
			s = f(s);
			count++;
			if (record.containsKey(s)) {
				System.out.println(count);
				break;
			}
			record.put(s, true);
		}
	}
	
	public static int f(int n) {
		if (n%2 == 0) {
			return n/2;
		}
		return 3*n+1;
	}
} public class Main {
	
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int s = sc.nextInt();
		
		HashMap<Integer, Boolean> record = new HashMap<Integer, Boolean>();
		record.put(s, true);
		int count = 1;
		while(true) {
			s = f(s);
			count++;
			if (record.containsKey(s)) {
				System.out.println(count);
				break;
			}
			record.put(s, true);
		}
	}
	
	public static int f(int n) {
		if (n%2 == 0) {
			return n/2;
		}
		return 3*n+1;
	}
} Main
import java.util.*;

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