import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        boolean flag = false;
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int idx = 0;
        int ans = 0;
        while (!flag) {
            int a = list.get(idx);
            if (a%2==0) {
                list.add(a/2);
            }else {
                list.add(a*3+1);
            }
            idx++;
            for (int i = 0; i < list.size()-1; i++) {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            }
        }
        System.out.println(ans);
    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        boolean flag = false;
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int idx = 0;
        int ans = 0;
        while (!flag) {
            int a = list.get(idx);
            if (a%2==0) {
                list.add(a/2);
            }else {
                list.add(a*3+1);
            }
            idx++;
            for (int i = 0; i < list.size()-1; i++) {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            }
        }
        System.out.println(ans);
    }
} Main public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        boolean flag = false;
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int idx = 0;
        int ans = 0;
        while (!flag) {
            int a = list.get(idx);
            if (a%2==0) {
                list.add(a/2);
            }else {
                list.add(a*3+1);
            }
            idx++;
            for (int i = 0; i < list.size()-1; i++) {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            }
        }
        System.out.println(ans);
    } main {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        boolean flag = false;
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int idx = 0;
        int ans = 0;
        while (!flag) {
            int a = list.get(idx);
            if (a%2==0) {
                list.add(a/2);
            }else {
                list.add(a*3+1);
            }
            idx++;
            for (int i = 0; i < list.size()-1; i++) {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            }
        }
        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int s = scan.nextInt(); s scan.nextInt() scan.nextInt scan boolean flag = false; flag false List<Integer> list = new ArrayList<>(); list new ArrayList<>() list.add(s) list.add list s int idx = 0; idx 0 int ans = 0; ans 0 while (!flag) {
            int a = list.get(idx);
            if (a%2==0) {
                list.add(a/2);
            }else {
                list.add(a*3+1);
            }
            idx++;
            for (int i = 0; i < list.size()-1; i++) {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            }
        } !flag flag {
            int a = list.get(idx);
            if (a%2==0) {
                list.add(a/2);
            }else {
                list.add(a*3+1);
            }
            idx++;
            for (int i = 0; i < list.size()-1; i++) {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            }
        } int a = list.get(idx); a list.get(idx) list.get list idx if (a%2==0) {
                list.add(a/2);
            }else {
                list.add(a*3+1);
            } a%2==0 a%2 a 2 0 {
                list.add(a/2);
            } list.add(a/2) list.add list a/2 a 2 {
                list.add(a*3+1);
            } list.add(a*3+1) list.add list a*3+1 a*3 a 3 1 idx++ idx for (int i = 0; i < list.size()-1; i++) {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            } int i = 0; int i = 0; i 0 i < list.size()-1 i list.size()-1 list.size() list.size list 1 i++ i++ i {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            } {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            } if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                } list.get(i) == list.get(list.size()-1) list.get(i) list.get list i list.get(list.size()-1) list.get list list.size()-1 list.size() list.size list 1 {
                    ans =list.size();
                    flag=true;
                    break;
                } ans =list.size() ans list.size() list.size list flag=true flag true break; System.out.println(ans) System.out.println System.out System System.out ans final String[] args args
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Main {
    public static void main(final String[] args) {
        Scanner scan = new Scanner(System.in);
        int s = scan.nextInt();
        boolean flag = false;
        List<Integer> list = new ArrayList<>();
        list.add(s);
        int idx = 0;
        int ans = 0;
        while (!flag) {
            int a = list.get(idx);
            if (a%2==0) {
                list.add(a/2);
            }else {
                list.add(a*3+1);
            }
            idx++;
            for (int i = 0; i < list.size()-1; i++) {
                if (list.get(i) == list.get(list.size()-1)) {
                    ans =list.size();
                    flag=true;
                    break;
                }
            }
        }
        System.out.println(ans);
    }
}
