import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		int S, x;
		Scanner sc = new Scanner(System.in);
		Set<Integer> hash_set = new HashSet<Integer>();

		S = sc.nextInt();
		x = S;

		while(hash_set.contains(x) == false) {
			hash_set.add(x);

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

		System.out.println(hash_set.size() + 1);

		sc.close();
	}

} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		int S, x;
		Scanner sc = new Scanner(System.in);
		Set<Integer> hash_set = new HashSet<Integer>();

		S = sc.nextInt();
		x = S;

		while(hash_set.contains(x) == false) {
			hash_set.add(x);

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

		System.out.println(hash_set.size() + 1);

		sc.close();
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		int S, x;
		Scanner sc = new Scanner(System.in);
		Set<Integer> hash_set = new HashSet<Integer>();

		S = sc.nextInt();
		x = S;

		while(hash_set.contains(x) == false) {
			hash_set.add(x);

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

		System.out.println(hash_set.size() + 1);

		sc.close();
	} main {
		// TODO 自動生成されたメソッド・スタブ

		int S, x;
		Scanner sc = new Scanner(System.in);
		Set<Integer> hash_set = new HashSet<Integer>();

		S = sc.nextInt();
		x = S;

		while(hash_set.contains(x) == false) {
			hash_set.add(x);

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

		System.out.println(hash_set.size() + 1);

		sc.close();
	} int S S x; x Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Set<Integer> hash_set = new HashSet<Integer>(); hash_set new HashSet<Integer>() S = sc.nextInt() S sc.nextInt() sc.nextInt sc x = S x S while(hash_set.contains(x) == false) {
			hash_set.add(x);

			if(x % 2 == 0) {
				x /= 2;
			} else {
				x = 3 * x + 1;
			}
		} hash_set.contains(x) == false hash_set.contains(x) hash_set.contains hash_set x false {
			hash_set.add(x);

			if(x % 2 == 0) {
				x /= 2;
			} else {
				x = 3 * x + 1;
			}
		} hash_set.add(x) hash_set.add hash_set x if(x % 2 == 0) {
				x /= 2;
			} else {
				x = 3 * x + 1;
			} x % 2 == 0 x % 2 x 2 0 {
				x /= 2;
			} x /= 2 x 2 {
				x = 3 * x + 1;
			} x = 3 * x + 1 x 3 * x + 1 3 * x 3 x 1 System.out.println(hash_set.size() + 1) System.out.println System.out System System.out hash_set.size() + 1 hash_set.size() hash_set.size hash_set 1 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		int S, x;
		Scanner sc = new Scanner(System.in);
		Set<Integer> hash_set = new HashSet<Integer>();

		S = sc.nextInt();
		x = S;

		while(hash_set.contains(x) == false) {
			hash_set.add(x);

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

		System.out.println(hash_set.size() + 1);

		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		int S, x;
		Scanner sc = new Scanner(System.in);
		Set<Integer> hash_set = new HashSet<Integer>();

		S = sc.nextInt();
		x = S;

		while(hash_set.contains(x) == false) {
			hash_set.add(x);

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

		System.out.println(hash_set.size() + 1);

		sc.close();
	}

} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		int S, x;
		Scanner sc = new Scanner(System.in);
		Set<Integer> hash_set = new HashSet<Integer>();

		S = sc.nextInt();
		x = S;

		while(hash_set.contains(x) == false) {
			hash_set.add(x);

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

		System.out.println(hash_set.size() + 1);

		sc.close();
	}

}