
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int m = 1;
        Set<Integer> used = new HashSet<>();
        for (; !used.contains(s); m++) {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        }
        System.out.println(m);
    }

    public static void main(String[] args) {
        new Main().run();
    }
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int m = 1;
        Set<Integer> used = new HashSet<>();
        for (; !used.contains(s); m++) {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        }
        System.out.println(m);
    }

    public static void main(String[] args) {
        new Main().run();
    }
} Main void run() {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int m = 1;
        Set<Integer> used = new HashSet<>();
        for (; !used.contains(s); m++) {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        }
        System.out.println(m);
    } run {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int m = 1;
        Set<Integer> used = new HashSet<>();
        for (; !used.contains(s); m++) {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        }
        System.out.println(m);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int m = 1; m 1 Set<Integer> used = new HashSet<>(); used new HashSet<>() for (; !used.contains(s); m++) {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        } ; !used.contains(s) used.contains(s) used.contains used s m++ m++ m {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        } {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        } used.add(s) used.add used s if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            } s % 2 == 0 s % 2 s 2 0 {
                s /= 2;
            } s /= 2 s 2 {
                s = s * 3 + 1;
            } s = s * 3 + 1 s s * 3 + 1 s * 3 s 3 1 System.out.println(m) System.out.println System.out System System.out m public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int m = 1;
        Set<Integer> used = new HashSet<>();
        for (; !used.contains(s); m++) {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        }
        System.out.println(m);
    }

    public static void main(String[] args) {
        new Main().run();
    }
} public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int m = 1;
        Set<Integer> used = new HashSet<>();
        for (; !used.contains(s); m++) {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        }
        System.out.println(m);
    }

    public static void main(String[] args) {
        new Main().run();
    }
} Main

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int m = 1;
        Set<Integer> used = new HashSet<>();
        for (; !used.contains(s); m++) {
            used.add(s);
            if (s % 2 == 0) {
                s /= 2;
            } else {
                s = s * 3 + 1;
            }
        }
        System.out.println(m);
    }

    public static void main(String[] args) {
        new Main().run();
    }
}
