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

public class Main {
	public static void main(String[] args) {

		List<Integer> list = new ArrayList<>();
		int answer = 0;

		Scanner scanner = new Scanner(System.in);

		int s = scanner.nextInt();
		list.add(s);

		while(true) {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		}
		System.out.println(answer);
	}

	public static int search(int n, List<Integer> list) {

		for(int i = 0; i < list.size(); i++) {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		}
		return 0;
	}

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		List<Integer> list = new ArrayList<>();
		int answer = 0;

		Scanner scanner = new Scanner(System.in);

		int s = scanner.nextInt();
		list.add(s);

		while(true) {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		}
		System.out.println(answer);
	}

	public static int search(int n, List<Integer> list) {

		for(int i = 0; i < list.size(); i++) {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		}
		return 0;
	}

} Main public static void main(String[] args) {

		List<Integer> list = new ArrayList<>();
		int answer = 0;

		Scanner scanner = new Scanner(System.in);

		int s = scanner.nextInt();
		list.add(s);

		while(true) {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		}
		System.out.println(answer);
	} main {

		List<Integer> list = new ArrayList<>();
		int answer = 0;

		Scanner scanner = new Scanner(System.in);

		int s = scanner.nextInt();
		list.add(s);

		while(true) {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		}
		System.out.println(answer);
	} List<Integer> list = new ArrayList<>(); list new ArrayList<>() int answer = 0; answer 0 Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int s = scanner.nextInt(); s scanner.nextInt() scanner.nextInt scanner list.add(s) list.add list s while(true) {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		} true {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		} if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			} s%2 == 0 s%2 s 2 0 {
				s = s/2;
			} s = s/2 s s/2 s 2 {
				s = 3*s + 1;
			} s = 3*s + 1 s 3*s + 1 3*s 3 s 1 answer = search(s, list) answer search(s, list) search s list if(answer != 0) {
				break;
			} answer != 0 answer 0 {
				break;
			} break; list.add(Integer.valueOf(s)) list.add list Integer.valueOf(s) Integer.valueOf Integer s System.out.println(answer) System.out.println System.out System System.out answer String[] args args public static int search(int n, List<Integer> list) {

		for(int i = 0; i < list.size(); i++) {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		}
		return 0;
	} search {

		for(int i = 0; i < list.size(); i++) {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		}
		return 0;
	} for(int i = 0; i < list.size(); i++) {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		} int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		} {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		} if(list.get(i) == n) {
				return list.size() + 1;
			} list.get(i) == n list.get(i) list.get list i n {
				return list.size() + 1;
			} return list.size() + 1; list.size() + 1 list.size() list.size list 1 return 0; 0 int n n List<Integer> list list public class Main {
	public static void main(String[] args) {

		List<Integer> list = new ArrayList<>();
		int answer = 0;

		Scanner scanner = new Scanner(System.in);

		int s = scanner.nextInt();
		list.add(s);

		while(true) {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		}
		System.out.println(answer);
	}

	public static int search(int n, List<Integer> list) {

		for(int i = 0; i < list.size(); i++) {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		}
		return 0;
	}

} public class Main {
	public static void main(String[] args) {

		List<Integer> list = new ArrayList<>();
		int answer = 0;

		Scanner scanner = new Scanner(System.in);

		int s = scanner.nextInt();
		list.add(s);

		while(true) {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		}
		System.out.println(answer);
	}

	public static int search(int n, List<Integer> list) {

		for(int i = 0; i < list.size(); i++) {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		}
		return 0;
	}

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		List<Integer> list = new ArrayList<>();
		int answer = 0;

		Scanner scanner = new Scanner(System.in);

		int s = scanner.nextInt();
		list.add(s);

		while(true) {
			if(s%2 == 0) {
				s = s/2;
			}
			else {
				s = 3*s + 1;
			}
			answer = search(s, list);
			if(answer != 0) {
				break;
			}
			list.add(Integer.valueOf(s));
		}
		System.out.println(answer);
	}

	public static int search(int n, List<Integer> list) {

		for(int i = 0; i < list.size(); i++) {
			if(list.get(i) == n) {
				return list.size() + 1;
			}
		}
		return 0;
	}

}