import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ky112233
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BCollatzProblem solver = new BCollatzProblem();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCollatzProblem {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int s = in.nextInt();
            Set<Integer> set = new HashSet<>();
            int cnt = 1;
            int temp = s;
            do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp));
            out.println(cnt);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io 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) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BCollatzProblem solver = new BCollatzProblem();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCollatzProblem {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int s = in.nextInt();
            Set<Integer> set = new HashSet<>();
            int cnt = 1;
            int temp = s;
            do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp));
            out.println(cnt);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BCollatzProblem solver = new BCollatzProblem();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BCollatzProblem solver = new BCollatzProblem();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) BCollatzProblem solver = new BCollatzProblem(); solver new BCollatzProblem() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class BCollatzProblem {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int s = in.nextInt();
            Set<Integer> set = new HashSet<>();
            int cnt = 1;
            int temp = s;
            do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp));
            out.println(cnt);
        }

    } BCollatzProblem public void solve(int testNumber, Scanner in, PrintWriter out) {
            int s = in.nextInt();
            Set<Integer> set = new HashSet<>();
            int cnt = 1;
            int temp = s;
            do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp));
            out.println(cnt);
        } solve {
            int s = in.nextInt();
            Set<Integer> set = new HashSet<>();
            int cnt = 1;
            int temp = s;
            do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp));
            out.println(cnt);
        } int s = in.nextInt(); s in.nextInt() in.nextInt in Set<Integer> set = new HashSet<>(); set new HashSet<>() int cnt = 1; cnt 1 int temp = s; temp s do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp)); !set.contains(temp) set.contains(temp) set.contains set temp {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } set.add(temp) set.add set temp if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1; temp % 2 == 0 temp % 2 temp 2 0 temp /= 2 temp 2 temp = temp * 3 + 1 temp temp * 3 + 1 temp * 3 temp 3 1 cnt++ cnt out.println(cnt) out.println out cnt int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BCollatzProblem solver = new BCollatzProblem();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCollatzProblem {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int s = in.nextInt();
            Set<Integer> set = new HashSet<>();
            int cnt = 1;
            int temp = s;
            do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp));
            out.println(cnt);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BCollatzProblem solver = new BCollatzProblem();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCollatzProblem {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int s = in.nextInt();
            Set<Integer> set = new HashSet<>();
            int cnt = 1;
            int temp = s;
            do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp));
            out.println(cnt);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ky112233
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BCollatzProblem solver = new BCollatzProblem();
        solver.solve(1, in, out);
        out.close();
    }

    static class BCollatzProblem {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int s = in.nextInt();
            Set<Integer> set = new HashSet<>();
            int cnt = 1;
            int temp = s;
            do {
                set.add(temp);
                if (temp % 2 == 0) temp /= 2;
                else temp = temp * 3 + 1;
                cnt++;
            } while (!set.contains(temp));
            out.println(cnt);
        }

    }
}

