import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int[] arr = new int[1000000];

        int index = 0;
        int res = 0;
        while (true) {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        }

        System.out.println(res+1);
    }

    private static boolean hasNum(int[] arr, int key, int index) {
        boolean res = false;

        for (int i = 0; i <= index; i++) {
            if (arr[i] == key) {
                res = true;
                break;
            }
        }

        return res;
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int[] arr = new int[1000000];

        int index = 0;
        int res = 0;
        while (true) {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        }

        System.out.println(res+1);
    }

    private static boolean hasNum(int[] arr, int key, int index) {
        boolean res = false;

        for (int i = 0; i <= index; i++) {
            if (arr[i] == key) {
                res = true;
                break;
            }
        }

        return res;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int[] arr = new int[1000000];

        int index = 0;
        int res = 0;
        while (true) {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        }

        System.out.println(res+1);
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int[] arr = new int[1000000];

        int index = 0;
        int res = 0;
        while (true) {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        }

        System.out.println(res+1);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int[] arr = new int[1000000]; arr new int[1000000] 1000000 int index = 0; index 0 int res = 0; res 0 while (true) {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        } true {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        } if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            } index == 0 index 0 {
                arr[index] = s;
                index++;
                continue;
            } arr[index] = s arr[index] arr index s index++ index continue; if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            } arr[index-1] % 2 == 0 arr[index-1] % 2 arr[index-1] arr index-1 index 1 2 0 {
                arr[index] = arr[index-1]/2;
            } arr[index] = arr[index-1]/2 arr[index] arr index arr[index-1]/2 arr[index-1] arr index-1 index 1 2 {
                arr[index] = 3 * arr[index-1] +1;
            } arr[index] = 3 * arr[index-1] +1 arr[index] arr index 3 * arr[index-1] +1 3 * arr[index-1] 3 arr[index-1] arr index-1 index 1 1 if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            } hasNum(arr, arr[index], index-1) && arr[index] != 0 hasNum(arr, arr[index], index-1) hasNum arr arr[index] arr index index-1 index 1 arr[index] != 0 arr[index] arr index 0 {
                res = index;
                break;
            } res = index res index break; index++ index System.out.println(res+1) System.out.println System.out System System.out res+1 res 1 String[] args args private static boolean hasNum(int[] arr, int key, int index) {
        boolean res = false;

        for (int i = 0; i <= index; i++) {
            if (arr[i] == key) {
                res = true;
                break;
            }
        }

        return res;
    } hasNum {
        boolean res = false;

        for (int i = 0; i <= index; i++) {
            if (arr[i] == key) {
                res = true;
                break;
            }
        }

        return res;
    } boolean res = false; res false for (int i = 0; i <= index; i++) {
            if (arr[i] == key) {
                res = true;
                break;
            }
        } int i = 0; int i = 0; i 0 i <= index i index i++ i++ i {
            if (arr[i] == key) {
                res = true;
                break;
            }
        } {
            if (arr[i] == key) {
                res = true;
                break;
            }
        } if (arr[i] == key) {
                res = true;
                break;
            } arr[i] == key arr[i] arr i key {
                res = true;
                break;
            } res = true res true break; return res; res int[] arr arr int key key int index index public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int[] arr = new int[1000000];

        int index = 0;
        int res = 0;
        while (true) {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        }

        System.out.println(res+1);
    }

    private static boolean hasNum(int[] arr, int key, int index) {
        boolean res = false;

        for (int i = 0; i <= index; i++) {
            if (arr[i] == key) {
                res = true;
                break;
            }
        }

        return res;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int[] arr = new int[1000000];

        int index = 0;
        int res = 0;
        while (true) {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        }

        System.out.println(res+1);
    }

    private static boolean hasNum(int[] arr, int key, int index) {
        boolean res = false;

        for (int i = 0; i <= index; i++) {
            if (arr[i] == key) {
                res = true;
                break;
            }
        }

        return res;
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int[] arr = new int[1000000];

        int index = 0;
        int res = 0;
        while (true) {
            if (index == 0) {
                arr[index] = s;
                index++;
                continue;
            } else if(arr[index-1] % 2 == 0) {
                arr[index] = arr[index-1]/2;
            } else {
                arr[index] = 3 * arr[index-1] +1;
            }

            if (hasNum(arr, arr[index], index-1) && arr[index] != 0) {
                res = index;
                break;
            }

            index++;
        }

        System.out.println(res+1);
    }

    private static boolean hasNum(int[] arr, int key, int index) {
        boolean res = false;

        for (int i = 0; i <= index; i++) {
            if (arr[i] == key) {
                res = true;
                break;
            }
        }

        return res;
    }
}
