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

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        long s = scanner.nextLong();

        HashSet<Long> observed = new HashSet<>();
        observed.add(s);

        long prev = s;

        for(int i=2; i<1000000; i++){

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        }

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

        Scanner scanner = new Scanner(System.in);

        long s = scanner.nextLong();

        HashSet<Long> observed = new HashSet<>();
        observed.add(s);

        long prev = s;

        for(int i=2; i<1000000; i++){

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        }

    }
} Main public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        long s = scanner.nextLong();

        HashSet<Long> observed = new HashSet<>();
        observed.add(s);

        long prev = s;

        for(int i=2; i<1000000; i++){

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        }

    } main {

        Scanner scanner = new Scanner(System.in);

        long s = scanner.nextLong();

        HashSet<Long> observed = new HashSet<>();
        observed.add(s);

        long prev = s;

        for(int i=2; i<1000000; i++){

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        }

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long s = scanner.nextLong(); s scanner.nextLong() scanner.nextLong scanner HashSet<Long> observed = new HashSet<>(); observed new HashSet<>() observed.add(s) observed.add observed s long prev = s; prev s for(int i=2; i<1000000; i++){

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        } int i=2; int i=2; i 2 i<1000000 i 1000000 i++ i++ i {

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        } {

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        } long candidate; candidate if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            } prev%2 == 0 prev%2 prev 2 0 {
                candidate = prev / 2;
            } candidate = prev / 2 candidate prev / 2 prev 2 {
                candidate = 3 * prev + 1;
            } candidate = 3 * prev + 1 candidate 3 * prev + 1 3 * prev 3 prev 1 if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            } observed.contains(candidate) observed.contains observed candidate {
                System.out.println(i);
                return;
            } System.out.println(i) System.out.println System.out System System.out i return; {
                observed.add(candidate);
                prev = candidate;
            } observed.add(candidate) observed.add observed candidate prev = candidate prev candidate String[] args args public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        long s = scanner.nextLong();

        HashSet<Long> observed = new HashSet<>();
        observed.add(s);

        long prev = s;

        for(int i=2; i<1000000; i++){

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        }

    }
} public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        long s = scanner.nextLong();

        HashSet<Long> observed = new HashSet<>();
        observed.add(s);

        long prev = s;

        for(int i=2; i<1000000; i++){

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        }

    }
} Main
import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        long s = scanner.nextLong();

        HashSet<Long> observed = new HashSet<>();
        observed.add(s);

        long prev = s;

        for(int i=2; i<1000000; i++){

            long candidate;
            if(prev%2 == 0){
                candidate = prev / 2;
            }else{
                candidate = 3 * prev + 1;
            }

            if(observed.contains(candidate)){
                System.out.println(i);
                return;
            }else{
                observed.add(candidate);
                prev = candidate;
            }
        }

    }
}