import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

public class Main {

    public static void main(String[] args)
    {
	    Set<Integer> set = new HashSet();
	    int a = getInput();
        do {
            set.add(a);
            a = f(a);
        } while (!set.contains(a));
        System.out.println(set.size() + 1);
        return;
    }

    private static int f(int n)
    {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    }

    private static int getInput()
    {
        int ret = 0;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            ret = Integer.parseInt(br.readLine().trim());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
        return ret;
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.HashSet; HashSet java.util import java.util.Set; Set java.util public class Main {

    public static void main(String[] args)
    {
	    Set<Integer> set = new HashSet();
	    int a = getInput();
        do {
            set.add(a);
            a = f(a);
        } while (!set.contains(a));
        System.out.println(set.size() + 1);
        return;
    }

    private static int f(int n)
    {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    }

    private static int getInput()
    {
        int ret = 0;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            ret = Integer.parseInt(br.readLine().trim());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
        return ret;
    }

} Main public static void main(String[] args)
    {
	    Set<Integer> set = new HashSet();
	    int a = getInput();
        do {
            set.add(a);
            a = f(a);
        } while (!set.contains(a));
        System.out.println(set.size() + 1);
        return;
    } main {
	    Set<Integer> set = new HashSet();
	    int a = getInput();
        do {
            set.add(a);
            a = f(a);
        } while (!set.contains(a));
        System.out.println(set.size() + 1);
        return;
    } Set<Integer> set = new HashSet(); set new HashSet() int a = getInput(); a getInput() getInput do {
            set.add(a);
            a = f(a);
        } while (!set.contains(a)); !set.contains(a) set.contains(a) set.contains set a {
            set.add(a);
            a = f(a);
        } set.add(a) set.add set a a = f(a) a f(a) f a System.out.println(set.size() + 1) System.out.println System.out System System.out set.size() + 1 set.size() set.size set 1 return; String[] args args private static int f(int n)
    {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    } f {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    } if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        } n % 2 == 0 n % 2 n 2 0 {
            return n / 2;
        } return n / 2; n / 2 n 2 {
            return 3 * n + 1;
        } return 3 * n + 1; 3 * n + 1 3 * n 3 n 1 int n n private static int getInput()
    {
        int ret = 0;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            ret = Integer.parseInt(br.readLine().trim());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
        return ret;
    } getInput {
        int ret = 0;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            ret = Integer.parseInt(br.readLine().trim());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
        return ret;
    } int ret = 0; ret 0 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {
            ret = Integer.parseInt(br.readLine().trim());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        } IOException e {
            System.err.println(e.getMessage());
        } System.err.println(e.getMessage()) System.err.println System.err System System.err e.getMessage() e.getMessage e {
            ret = Integer.parseInt(br.readLine().trim());
        } ret = Integer.parseInt(br.readLine().trim()) ret Integer.parseInt(br.readLine().trim()) Integer.parseInt Integer br.readLine().trim() br.readLine().trim br.readLine() br.readLine br return ret; ret public class Main {

    public static void main(String[] args)
    {
	    Set<Integer> set = new HashSet();
	    int a = getInput();
        do {
            set.add(a);
            a = f(a);
        } while (!set.contains(a));
        System.out.println(set.size() + 1);
        return;
    }

    private static int f(int n)
    {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    }

    private static int getInput()
    {
        int ret = 0;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            ret = Integer.parseInt(br.readLine().trim());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
        return ret;
    }

} public class Main {

    public static void main(String[] args)
    {
	    Set<Integer> set = new HashSet();
	    int a = getInput();
        do {
            set.add(a);
            a = f(a);
        } while (!set.contains(a));
        System.out.println(set.size() + 1);
        return;
    }

    private static int f(int n)
    {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    }

    private static int getInput()
    {
        int ret = 0;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            ret = Integer.parseInt(br.readLine().trim());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
        return ret;
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

public class Main {

    public static void main(String[] args)
    {
	    Set<Integer> set = new HashSet();
	    int a = getInput();
        do {
            set.add(a);
            a = f(a);
        } while (!set.contains(a));
        System.out.println(set.size() + 1);
        return;
    }

    private static int f(int n)
    {
        if (n % 2 == 0) {
            return n / 2;
        } else {
            return 3 * n + 1;
        }
    }

    private static int getInput()
    {
        int ret = 0;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            ret = Integer.parseInt(br.readLine().trim());
        } catch (IOException e) {
            System.err.println(e.getMessage());
        }
        return ret;
    }

}
