
import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		 int s=scn.nextInt();
		 HashMap<Integer, Integer> hmap= new HashMap<>();
		 System.out.println(func(hmap,s,1));
	}

	public static int solve(int i, int a) {
		if(i==1) {
			return a;
		}
		if(a%2==0) {
			return a/2;
		}else {
			return 3*a+1;
		}
	}
	
	public static int func(HashMap<Integer, Integer> hmap, int a, int i) {
		if(hmap.containsKey(a)) {
			return i;
		}
		hmap.put(a, i);
		return func(hmap,solve(i+1,a),i+1);
	}
} import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		 int s=scn.nextInt();
		 HashMap<Integer, Integer> hmap= new HashMap<>();
		 System.out.println(func(hmap,s,1));
	}

	public static int solve(int i, int a) {
		if(i==1) {
			return a;
		}
		if(a%2==0) {
			return a/2;
		}else {
			return 3*a+1;
		}
	}
	
	public static int func(HashMap<Integer, Integer> hmap, int a, int i) {
		if(hmap.containsKey(a)) {
			return i;
		}
		hmap.put(a, i);
		return func(hmap,solve(i+1,a),i+1);
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		 int s=scn.nextInt();
		 HashMap<Integer, Integer> hmap= new HashMap<>();
		 System.out.println(func(hmap,s,1));
	} main {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		 int s=scn.nextInt();
		 HashMap<Integer, Integer> hmap= new HashMap<>();
		 System.out.println(func(hmap,s,1));
	} Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int s=scn.nextInt(); s scn.nextInt() scn.nextInt scn HashMap<Integer, Integer> hmap= new HashMap<>(); hmap new HashMap<>() System.out.println(func(hmap,s,1)) System.out.println System.out System System.out func(hmap,s,1) func hmap s 1 String[] args args public static int solve(int i, int a) {
		if(i==1) {
			return a;
		}
		if(a%2==0) {
			return a/2;
		}else {
			return 3*a+1;
		}
	} solve {
		if(i==1) {
			return a;
		}
		if(a%2==0) {
			return a/2;
		}else {
			return 3*a+1;
		}
	} if(i==1) {
			return a;
		} i==1 i 1 {
			return a;
		} return a; a if(a%2==0) {
			return a/2;
		}else {
			return 3*a+1;
		} a%2==0 a%2 a 2 0 {
			return a/2;
		} return a/2; a/2 a 2 {
			return 3*a+1;
		} return 3*a+1; 3*a+1 3*a 3 a 1 int i i int a a public static int func(HashMap<Integer, Integer> hmap, int a, int i) {
		if(hmap.containsKey(a)) {
			return i;
		}
		hmap.put(a, i);
		return func(hmap,solve(i+1,a),i+1);
	} func {
		if(hmap.containsKey(a)) {
			return i;
		}
		hmap.put(a, i);
		return func(hmap,solve(i+1,a),i+1);
	} if(hmap.containsKey(a)) {
			return i;
		} hmap.containsKey(a) hmap.containsKey hmap a {
			return i;
		} return i; i hmap.put(a, i) hmap.put hmap a i return func(hmap,solve(i+1,a),i+1); func(hmap,solve(i+1,a),i+1) func hmap solve(i+1,a) solve i+1 i 1 a i+1 i 1 HashMap<Integer, Integer> hmap hmap int a a int i i public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		 int s=scn.nextInt();
		 HashMap<Integer, Integer> hmap= new HashMap<>();
		 System.out.println(func(hmap,s,1));
	}

	public static int solve(int i, int a) {
		if(i==1) {
			return a;
		}
		if(a%2==0) {
			return a/2;
		}else {
			return 3*a+1;
		}
	}
	
	public static int func(HashMap<Integer, Integer> hmap, int a, int i) {
		if(hmap.containsKey(a)) {
			return i;
		}
		hmap.put(a, i);
		return func(hmap,solve(i+1,a),i+1);
	}
} public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		 int s=scn.nextInt();
		 HashMap<Integer, Integer> hmap= new HashMap<>();
		 System.out.println(func(hmap,s,1));
	}

	public static int solve(int i, int a) {
		if(i==1) {
			return a;
		}
		if(a%2==0) {
			return a/2;
		}else {
			return 3*a+1;
		}
	}
	
	public static int func(HashMap<Integer, Integer> hmap, int a, int i) {
		if(hmap.containsKey(a)) {
			return i;
		}
		hmap.put(a, i);
		return func(hmap,solve(i+1,a),i+1);
	}
} Main

import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		 int s=scn.nextInt();
		 HashMap<Integer, Integer> hmap= new HashMap<>();
		 System.out.println(func(hmap,s,1));
	}

	public static int solve(int i, int a) {
		if(i==1) {
			return a;
		}
		if(a%2==0) {
			return a/2;
		}else {
			return 3*a+1;
		}
	}
	
	public static int func(HashMap<Integer, Integer> hmap, int a, int i) {
		if(hmap.containsKey(a)) {
			return i;
		}
		hmap.put(a, i);
		return func(hmap,solve(i+1,a),i+1);
	}
}
