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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int value = s;
		List<Integer> list = new ArrayList<>();
		list.add(s);
		int ans = 1;
		boolean flag = false;
		while(!flag) {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		}
		System.out.println(ans);
	}

} 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) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int value = s;
		List<Integer> list = new ArrayList<>();
		list.add(s);
		int ans = 1;
		boolean flag = false;
		while(!flag) {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		}
		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int value = s;
		List<Integer> list = new ArrayList<>();
		list.add(s);
		int ans = 1;
		boolean flag = false;
		while(!flag) {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int value = s;
		List<Integer> list = new ArrayList<>();
		list.add(s);
		int ans = 1;
		boolean flag = false;
		while(!flag) {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int value = s; value s List<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(s) list.add list s int ans = 1; ans 1 boolean flag = false; flag false while(!flag) {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		} !flag flag {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		} ans++ ans if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			} value % 2 == 0 value % 2 value 2 0 {
				value /= 2;
			} value /= 2 value 2 {
				value = value * 3 + 1;
			} value = value * 3 + 1 value value * 3 + 1 value * 3 value 3 1 for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			} Integer i list {
				if(i == value) {
					flag = true;
				}
			} {
				if(i == value) {
					flag = true;
				}
			} if(i == value) {
					flag = true;
				} i == value i value {
					flag = true;
				} flag = true flag true list.add(value) list.add list value System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int value = s;
		List<Integer> list = new ArrayList<>();
		list.add(s);
		int ans = 1;
		boolean flag = false;
		while(!flag) {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		}
		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int value = s;
		List<Integer> list = new ArrayList<>();
		list.add(s);
		int ans = 1;
		boolean flag = false;
		while(!flag) {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		}
		System.out.println(ans);
	}

} Main

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int value = s;
		List<Integer> list = new ArrayList<>();
		list.add(s);
		int ans = 1;
		boolean flag = false;
		while(!flag) {
			ans++;
			if(value % 2 == 0) {
				value /= 2;
			} else {
				value = value * 3 + 1;
			}
			for(Integer i : list) {
				if(i == value) {
					flag = true;
				}
			}
			list.add(value);
		}
		System.out.println(ans);
	}

}
