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

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int S = reader.nextInt();
		reader.close();
		ArrayList<Integer> list = new  ArrayList<Integer>();
		int count = 1;
		while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		}
		System.out.print(count);
	}
}
 import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int S = reader.nextInt();
		reader.close();
		ArrayList<Integer> list = new  ArrayList<Integer>();
		int count = 1;
		while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		}
		System.out.print(count);
	}
} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int S = reader.nextInt();
		reader.close();
		ArrayList<Integer> list = new  ArrayList<Integer>();
		int count = 1;
		while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		}
		System.out.print(count);
	} main {
		Scanner reader = new Scanner(System.in);
		int S = reader.nextInt();
		reader.close();
		ArrayList<Integer> list = new  ArrayList<Integer>();
		int count = 1;
		while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		}
		System.out.print(count);
	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int S = reader.nextInt(); S reader.nextInt() reader.nextInt reader reader.close() reader.close reader ArrayList<Integer> list = new  ArrayList<Integer>(); list new  ArrayList<Integer>() int count = 1; count 1 while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		} !list.contains(S) list.contains(S) list.contains list S {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		} list.add(S) list.add list S if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			} S % 2 == 0 S % 2 S 2 0 {
				S /= 2;
			} S /= 2 S 2 {
				S = 3 * S + 1;
			} S = 3 * S + 1 S 3 * S + 1 3 * S 3 S 1 count++ count System.out.print(count) System.out.print System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int S = reader.nextInt();
		reader.close();
		ArrayList<Integer> list = new  ArrayList<Integer>();
		int count = 1;
		while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		}
		System.out.print(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int S = reader.nextInt();
		reader.close();
		ArrayList<Integer> list = new  ArrayList<Integer>();
		int count = 1;
		while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		}
		System.out.print(count);
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int S = reader.nextInt();
		reader.close();
		ArrayList<Integer> list = new  ArrayList<Integer>();
		int count = 1;
		while (!list.contains(S)) {
			list.add(S);
			if (S % 2 == 0) {
				S /= 2;
			} else {
				S = 3 * S + 1;
			}
			count++;
		}
		System.out.print(count);
	}
}

