import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int s = sc.nextInt();
		int nextVal = 0;
		boolean isExist = false;
		int cnt = 0;

		ArrayList<Integer> aryList = new ArrayList<Integer>();
		aryList.add(s);

		while(!isExist){
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		}

		System.out.println(cnt);

		sc.close();
	}

	private static int calc(int target){
		int ret = 0;

		if(target%2 == 0){
			ret = target / 2;
		}else{
			ret = 3 * target + 1;
		}

		return ret;
	}
} import java.util.ArrayList; ArrayList 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();
		int nextVal = 0;
		boolean isExist = false;
		int cnt = 0;

		ArrayList<Integer> aryList = new ArrayList<Integer>();
		aryList.add(s);

		while(!isExist){
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		}

		System.out.println(cnt);

		sc.close();
	}

	private static int calc(int target){
		int ret = 0;

		if(target%2 == 0){
			ret = target / 2;
		}else{
			ret = 3 * target + 1;
		}

		return ret;
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int s = sc.nextInt();
		int nextVal = 0;
		boolean isExist = false;
		int cnt = 0;

		ArrayList<Integer> aryList = new ArrayList<Integer>();
		aryList.add(s);

		while(!isExist){
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		}

		System.out.println(cnt);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int s = sc.nextInt();
		int nextVal = 0;
		boolean isExist = false;
		int cnt = 0;

		ArrayList<Integer> aryList = new ArrayList<Integer>();
		aryList.add(s);

		while(!isExist){
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		}

		System.out.println(cnt);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int nextVal = 0; nextVal 0 boolean isExist = false; isExist false int cnt = 0; cnt 0 ArrayList<Integer> aryList = new ArrayList<Integer>(); aryList new ArrayList<Integer>() aryList.add(s) aryList.add aryList s while(!isExist){
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		} !isExist isExist {
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		} nextVal = calc(s) nextVal calc(s) calc s if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			} aryList.contains(nextVal) aryList.contains aryList nextVal {
				cnt = aryList.size() + 1;
 				isExist = true;
			} cnt = aryList.size() + 1 cnt aryList.size() + 1 aryList.size() aryList.size aryList 1 isExist = true isExist true aryList.add(nextVal) aryList.add aryList nextVal s = nextVal s nextVal System.out.println(cnt) System.out.println System.out System System.out cnt sc.close() sc.close sc String[] args args private static int calc(int target){
		int ret = 0;

		if(target%2 == 0){
			ret = target / 2;
		}else{
			ret = 3 * target + 1;
		}

		return ret;
	} calc {
		int ret = 0;

		if(target%2 == 0){
			ret = target / 2;
		}else{
			ret = 3 * target + 1;
		}

		return ret;
	} int ret = 0; ret 0 if(target%2 == 0){
			ret = target / 2;
		}else{
			ret = 3 * target + 1;
		} target%2 == 0 target%2 target 2 0 {
			ret = target / 2;
		} ret = target / 2 ret target / 2 target 2 {
			ret = 3 * target + 1;
		} ret = 3 * target + 1 ret 3 * target + 1 3 * target 3 target 1 return ret; ret int target target public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int s = sc.nextInt();
		int nextVal = 0;
		boolean isExist = false;
		int cnt = 0;

		ArrayList<Integer> aryList = new ArrayList<Integer>();
		aryList.add(s);

		while(!isExist){
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		}

		System.out.println(cnt);

		sc.close();
	}

	private static int calc(int target){
		int ret = 0;

		if(target%2 == 0){
			ret = target / 2;
		}else{
			ret = 3 * target + 1;
		}

		return ret;
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int s = sc.nextInt();
		int nextVal = 0;
		boolean isExist = false;
		int cnt = 0;

		ArrayList<Integer> aryList = new ArrayList<Integer>();
		aryList.add(s);

		while(!isExist){
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		}

		System.out.println(cnt);

		sc.close();
	}

	private static int calc(int target){
		int ret = 0;

		if(target%2 == 0){
			ret = target / 2;
		}else{
			ret = 3 * target + 1;
		}

		return ret;
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int s = sc.nextInt();
		int nextVal = 0;
		boolean isExist = false;
		int cnt = 0;

		ArrayList<Integer> aryList = new ArrayList<Integer>();
		aryList.add(s);

		while(!isExist){
			nextVal = calc(s);

			if(aryList.contains(nextVal)){
				cnt = aryList.size() + 1;
 				isExist = true;
			}

            aryList.add(nextVal);
			s = nextVal;
		}

		System.out.println(cnt);

		sc.close();
	}

	private static int calc(int target){
		int ret = 0;

		if(target%2 == 0){
			ret = target / 2;
		}else{
			ret = 3 * target + 1;
		}

		return ret;
	}
}