import java.util.*;
import java.lang.*;

public class Main {
    
    static int s;
    static int[] a;

    
    public static void main (String args[]) {
        int ans = 0;

        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        a = new int[10000000];
        int i = 0;
        boolean issame = false;
        
        while(true) {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        }

        System.out.println(i + 1);
    }

} import java.util.*; util.* java import java.lang.*; lang.* java public class Main {
    
    static int s;
    static int[] a;

    
    public static void main (String args[]) {
        int ans = 0;

        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        a = new int[10000000];
        int i = 0;
        boolean issame = false;
        
        while(true) {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        }

        System.out.println(i + 1);
    }

} Main static int s; s static int[] a; a public static void main (String args[]) {
        int ans = 0;

        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        a = new int[10000000];
        int i = 0;
        boolean issame = false;
        
        while(true) {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        }

        System.out.println(i + 1);
    } main {
        int ans = 0;

        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        a = new int[10000000];
        int i = 0;
        boolean issame = false;
        
        while(true) {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        }

        System.out.println(i + 1);
    } int ans = 0; ans 0 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) s = sc.nextInt() s sc.nextInt() sc.nextInt sc a = new int[10000000] a new int[10000000] 10000000 int i = 0; i 0 boolean issame = false; issame false while(true) {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        } true {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        } if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            } i == 0 i 0 {
                a[i] = s;
            } a[i] = s a[i] a i s {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            } if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                } a[i-1] % 2 == 0 a[i-1] % 2 a[i-1] a i-1 i 1 2 0 {
                    a[i] = a[i-1] / 2;
                } a[i] = a[i-1] / 2 a[i] a i a[i-1] / 2 a[i-1] a i-1 i 1 2 {
                    a[i] = 3 * a[i - 1] + 1;
                } a[i] = 3 * a[i - 1] + 1 a[i] a i 3 * a[i - 1] + 1 3 * a[i - 1] 3 a[i - 1] a i - 1 i 1 1 for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            } int k = 0; int k = 0; k 0 k < i k i k++ k++ k {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            } {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            } if (a[k] == a[i]) {
                    issame = true;
                    break;
                } a[k] == a[i] a[k] a k a[i] a i {
                    issame = true;
                    break;
                } issame = true issame true break; if (issame) {
                break;
            } issame {
                break;
            } break; i++ i System.out.println(i + 1) System.out.println System.out System System.out i + 1 i 1 String args[] args public class Main {
    
    static int s;
    static int[] a;

    
    public static void main (String args[]) {
        int ans = 0;

        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        a = new int[10000000];
        int i = 0;
        boolean issame = false;
        
        while(true) {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        }

        System.out.println(i + 1);
    }

} public class Main {
    
    static int s;
    static int[] a;

    
    public static void main (String args[]) {
        int ans = 0;

        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        a = new int[10000000];
        int i = 0;
        boolean issame = false;
        
        while(true) {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        }

        System.out.println(i + 1);
    }

} Main
import java.util.*;
import java.lang.*;

public class Main {
    
    static int s;
    static int[] a;

    
    public static void main (String args[]) {
        int ans = 0;

        Scanner sc = new Scanner(System.in);
        s = sc.nextInt();
        a = new int[10000000];
        int i = 0;
        boolean issame = false;
        
        while(true) {
            if (i == 0) {
                a[i] = s;
            } else {
                if (a[i-1] % 2 == 0) {
                    a[i] = a[i-1] / 2;
                } else {
                    a[i] = 3 * a[i - 1] + 1;
                }
            }
            //System.out.println(a[i]);
            for (int k = 0; k < i; k++) {
                if (a[k] == a[i]) {
                    issame = true;
                    break;
                }
            }
            if (issame) {
                break;
            }
            i++;
        }

        System.out.println(i + 1);
    }

}