import java.util.BitSet;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();

		BitSet bit = new BitSet();
		bit.set(s);

		int count = 1;
		boolean check = true;
		while(check) {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		}

		System.out.print(count);
	}
} import java.util.BitSet; BitSet java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();

		BitSet bit = new BitSet();
		bit.set(s);

		int count = 1;
		boolean check = true;
		while(check) {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		}

		System.out.print(count);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();

		BitSet bit = new BitSet();
		bit.set(s);

		int count = 1;
		boolean check = true;
		while(check) {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		}

		System.out.print(count);
	} main {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();

		BitSet bit = new BitSet();
		bit.set(s);

		int count = 1;
		boolean check = true;
		while(check) {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		}

		System.out.print(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int s = scan.nextInt(); s scan.nextInt() scan.nextInt scan BitSet bit = new BitSet(); bit new BitSet() bit.set(s) bit.set bit s int count = 1; count 1 boolean check = true; check true while(check) {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		} check {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		} if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1; s % 2 == 0 s % 2 s 2 0 s /= 2 s 2 s = s * 3 + 1 s s * 3 + 1 s * 3 s 3 1 count += 1 count 1 if(bit.get(s)) check = false;
			else bit.set(s); bit.get(s) bit.get bit s check = false check false bit.set(s) bit.set bit s 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 scan = new Scanner(System.in);
		int s = scan.nextInt();

		BitSet bit = new BitSet();
		bit.set(s);

		int count = 1;
		boolean check = true;
		while(check) {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		}

		System.out.print(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();

		BitSet bit = new BitSet();
		bit.set(s);

		int count = 1;
		boolean check = true;
		while(check) {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		}

		System.out.print(count);
	}
} Main
import java.util.BitSet;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int s = scan.nextInt();

		BitSet bit = new BitSet();
		bit.set(s);

		int count = 1;
		boolean check = true;
		while(check) {
			if(s % 2 == 0) s /= 2;
			else s = s * 3 + 1;
			count += 1;

			if(bit.get(s)) check = false;
			else bit.set(s);
		}

		System.out.print(count);
	}
}