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

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int index = 0;
        int ans = 0;
        while(true) {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        }
    }
    public static int odd (int n) {
    	return 3 * n + 1;
    }
    public static int even(int n) {
    	return n / 2;
    }
} 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 scan = new Scanner(System.in);
        int s = scan.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int index = 0;
        int ans = 0;
        while(true) {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        }
    }
    public static int odd (int n) {
    	return 3 * n + 1;
    }
    public static int even(int n) {
    	return n / 2;
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int index = 0;
        int ans = 0;
        while(true) {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int index = 0;
        int ans = 0;
        while(true) {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int s = scan.nextInt(); s scan.nextInt() scan.nextInt scan List<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(s) list.add list s int index = 0; index 0 int ans = 0; ans 0 while(true) {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        } true {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        } int temp = list.get(index); temp list.get(index) list.get list index if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	} temp % 2 == 0 temp % 2 temp 2 0 {
        		temp = even(temp);
        	} temp = even(temp) temp even(temp) even temp {
        		temp = odd(temp);
        	} temp = odd(temp) temp odd(temp) odd temp if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	} list.contains(temp) list.contains list temp {
        		System.out.println(list.size() + 1);
        		return;
        	} System.out.println(list.size() + 1) System.out.println System.out System System.out list.size() + 1 list.size() list.size list 1 return; list.add(temp) list.add list temp index++ index String[] args args public static int odd (int n) {
    	return 3 * n + 1;
    } odd {
    	return 3 * n + 1;
    } return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n public static int even(int n) {
    	return n / 2;
    } even {
    	return n / 2;
    } return n / 2; n / 2 n 2 int n n public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int index = 0;
        int ans = 0;
        while(true) {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        }
    }
    public static int odd (int n) {
    	return 3 * n + 1;
    }
    public static int even(int n) {
    	return n / 2;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int index = 0;
        int ans = 0;
        while(true) {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        }
    }
    public static int odd (int n) {
    	return 3 * n + 1;
    }
    public static int even(int n) {
    	return n / 2;
    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int index = 0;
        int ans = 0;
        while(true) {
        	int temp = list.get(index);
        	if(temp % 2 == 0) {
        		temp = even(temp);
        	}else {
        		temp = odd(temp);
        	}

        	if(list.contains(temp)) {
        		System.out.println(list.size() + 1);
        		return;
        	}
        	list.add(temp);
        	index++;
        }
    }
    public static int odd (int n) {
    	return 3 * n + 1;
    }
    public static int even(int n) {
    	return n / 2;
    }
}