import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int s = scan.nextInt();
        int index = 1;
        HashSet<Integer> set = new HashSet<>();
        set.add(s);
        while(true) {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        }
        System.out.println(index);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int s = scan.nextInt();
        int index = 1;
        HashSet<Integer> set = new HashSet<>();
        set.add(s);
        while(true) {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        }
        System.out.println(index);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int s = scan.nextInt();
        int index = 1;
        HashSet<Integer> set = new HashSet<>();
        set.add(s);
        while(true) {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        }
        System.out.println(index);
    } main {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int s = scan.nextInt();
        int index = 1;
        HashSet<Integer> set = new HashSet<>();
        set.add(s);
        while(true) {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        }
        System.out.println(index);
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) int s = scan.nextInt(); s scan.nextInt() scan.nextInt scan int index = 1; index 1 HashSet<Integer> set = new HashSet<>(); set new HashSet<>() set.add(s) set.add set s while(true) {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        } true {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        } index += 1 index 1 if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            } s % 2 == 0 s % 2 s 2 0 {
                s = s / 2;
            } s = s / 2 s s / 2 s 2 {
                s = 3 * s + 1;
            } s = 3 * s + 1 s 3 * s + 1 3 * s 3 s 1 if (set.contains(s)) {
                break;
            } set.contains(s) set.contains set s {
                break;
            } break; set.add(s) set.add set s System.out.println(index) System.out.println System.out System System.out index String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int s = scan.nextInt();
        int index = 1;
        HashSet<Integer> set = new HashSet<>();
        set.add(s);
        while(true) {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        }
        System.out.println(index);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int s = scan.nextInt();
        int index = 1;
        HashSet<Integer> set = new HashSet<>();
        set.add(s);
        while(true) {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        }
        System.out.println(index);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int s = scan.nextInt();
        int index = 1;
        HashSet<Integer> set = new HashSet<>();
        set.add(s);
        while(true) {
            index += 1;
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            if (set.contains(s)) {
                break;
            }
            set.add(s);
        }
        System.out.println(index);
    }
}
