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

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        final Set<Integer> appeared = new HashSet<>();
        int m = 1;
        do {
            appeared.add(s);
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            m++;
        } while (!appeared.contains(s));
        System.out.println(m);
    }
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        final Set<Integer> appeared = new HashSet<>();
        int m = 1;
        do {
            appeared.add(s);
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            m++;
        } while (!appeared.contains(s));
        System.out.println(m);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        final Set<Integer> appeared = new HashSet<>();
        int m = 1;
        do {
            appeared.add(s);
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            m++;
        } while (!appeared.contains(s));
        System.out.println(m);
    } main {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        final Set<Integer> appeared = new HashSet<>();
        int m = 1;
        do {
            appeared.add(s);
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            m++;
        } while (!appeared.contains(s));
        System.out.println(m);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int s = scanner.nextInt(); s scanner.nextInt() scanner.nextInt scanner final Set<Integer> appeared = new HashSet<>(); appeared new HashSet<>() int m = 1; m 1 do {
            appeared.add(s);
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            m++;
        } while (!appeared.contains(s)); !appeared.contains(s) appeared.contains(s) appeared.contains appeared s {
            appeared.add(s);
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            m++;
        } appeared.add(s) appeared.add appeared s 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 m++ m System.out.println(m) System.out.println System.out System System.out m String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        final Set<Integer> appeared = new HashSet<>();
        int m = 1;
        do {
            appeared.add(s);
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            m++;
        } while (!appeared.contains(s));
        System.out.println(m);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        final Set<Integer> appeared = new HashSet<>();
        int m = 1;
        do {
            appeared.add(s);
            if (s % 2 == 0) {
                s = s / 2;
            } else {
                s = 3 * s + 1;
            }
            m++;
        } while (!appeared.contains(s));
        System.out.println(m);
    }
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

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