//package atcoder;

import java.io.*;
import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        HashSet<Long> set = new HashSet<>();
        set.add(n);
        long k = n % 2 == 0 ? n/2 : 3L*n + 1L;
        int count = 2;
        while(!set.contains(k)) {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        }
        System.out.println(count);

    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        HashSet<Long> set = new HashSet<>();
        set.add(n);
        long k = n % 2 == 0 ? n/2 : 3L*n + 1L;
        int count = 2;
        while(!set.contains(k)) {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        }
        System.out.println(count);

    }
} Main public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        HashSet<Long> set = new HashSet<>();
        set.add(n);
        long k = n % 2 == 0 ? n/2 : 3L*n + 1L;
        int count = 2;
        while(!set.contains(k)) {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        }
        System.out.println(count);

    } main {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        HashSet<Long> set = new HashSet<>();
        set.add(n);
        long k = n % 2 == 0 ? n/2 : 3L*n + 1L;
        int count = 2;
        while(!set.contains(k)) {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        }
        System.out.println(count);

    } Scanner s = new Scanner(System.in); s new Scanner(System.in) long n = s.nextLong(); n s.nextLong() s.nextLong s HashSet<Long> set = new HashSet<>(); set new HashSet<>() set.add(n) set.add set n long k = n % 2 == 0 ? n/2 : 3L*n + 1L; k n % 2 == 0 ? n/2 : 3L*n + 1L n % 2 == 0 n % 2 n 2 0 n/2 n 2 3L*n + 1L 3L*n 3L n 1L int count = 2; count 2 while(!set.contains(k)) {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        } !set.contains(k) set.contains(k) set.contains set k {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        } set.add(k) set.add set k count++ count if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            } k %2 == 0 k %2 k 2 0 {
                k /= 2;
            } k /= 2 k 2 {
                k = 3L*k + 1L;
            } k = 3L*k + 1L k 3L*k + 1L 3L*k 3L k 1L System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        HashSet<Long> set = new HashSet<>();
        set.add(n);
        long k = n % 2 == 0 ? n/2 : 3L*n + 1L;
        int count = 2;
        while(!set.contains(k)) {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        }
        System.out.println(count);

    }
} public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        HashSet<Long> set = new HashSet<>();
        set.add(n);
        long k = n % 2 == 0 ? n/2 : 3L*n + 1L;
        int count = 2;
        while(!set.contains(k)) {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        }
        System.out.println(count);

    }
} Main
//package atcoder;

import java.io.*;
import java.util.*;


public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        long n = s.nextLong();
        HashSet<Long> set = new HashSet<>();
        set.add(n);
        long k = n % 2 == 0 ? n/2 : 3L*n + 1L;
        int count = 2;
        while(!set.contains(k)) {
            set.add(k);
            count++;
            if(k %2 == 0) {
                k /= 2;
            } else {
                k = 3L*k + 1L;
            }
        }
        System.out.println(count);

    }
}
