import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int S = sc.nextInt();
    	List<Integer> list = new ArrayList<>();
    	list.add(S);
    	while (true) {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	}
    	System.out.println(list.size()+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();
    	List<Integer> list = new ArrayList<>();
    	list.add(S);
    	while (true) {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	}
    	System.out.println(list.size()+1);
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int S = sc.nextInt();
    	List<Integer> list = new ArrayList<>();
    	list.add(S);
    	while (true) {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	}
    	System.out.println(list.size()+1);
    } main {
    	Scanner sc = new Scanner(System.in);
    	int S = sc.nextInt();
    	List<Integer> list = new ArrayList<>();
    	list.add(S);
    	while (true) {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	}
    	System.out.println(list.size()+1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int S = sc.nextInt(); S sc.nextInt() sc.nextInt sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(S) list.add list S while (true) {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	} true {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	} if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} S%2 == 0 S%2 S 2 0 {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} S /= 2 S 2 if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		} list.contains(S) list.contains list S {
        			break;
        		} break; {
        			list.add(S);
        		} list.add(S) list.add list S {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} S = 3*S+1 S 3*S+1 3*S 3 S 1 if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		} list.contains(S) list.contains list S {
        			break;
        		} break; {
        			list.add(S);
        		} list.add(S) list.add list S System.out.println(list.size()+1) System.out.println System.out System System.out list.size()+1 list.size() list.size list 1 String[] args args public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int S = sc.nextInt();
    	List<Integer> list = new ArrayList<>();
    	list.add(S);
    	while (true) {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	}
    	System.out.println(list.size()+1);
    }
} public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int S = sc.nextInt();
    	List<Integer> list = new ArrayList<>();
    	list.add(S);
    	while (true) {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	}
    	System.out.println(list.size()+1);
    }
} Main
import java.util.*;
 
public class Main {
	
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int S = sc.nextInt();
    	List<Integer> list = new ArrayList<>();
    	list.add(S);
    	while (true) {
        	if (S%2 == 0) {
        		S /= 2;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	} else {
        		S = 3*S+1;
        		if (list.contains(S)) {
        			break;
        		} else {
        			list.add(S);
        		}
        	}
    	}
    	System.out.println(list.size()+1);
    }
}