import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);

    for(int i = 2 ; i < 1000001 ; ++i){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    }
    
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);

    for(int i = 2 ; i < 1000001 ; ++i){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    }
    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);

    for(int i = 2 ; i < 1000001 ; ++i){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    }
    
  } main {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);

    for(int i = 2 ; i < 1000001 ; ++i){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    }
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Set<Integer> set = new HashSet<>(); set new HashSet<>() set.add(s) set.add set s for(int i = 2 ; i < 1000001 ; ++i){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    } int i = 2 ; int i = 2 ; i 2 i < 1000001 i 1000001 ++i ++i i {
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    } {
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    } if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      } s%2 == 0 s%2 s 2 0 {
        s = s/2;
      } s = s/2 s s/2 s 2 {
        s = s*3 + 1;
      } s = s*3 + 1 s s*3 + 1 s*3 s 3 1 if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      } set.add(s) set.add set s {
        set.add(s);
      } set.add(s) set.add set s {
        System.out.println(i);
        break;
      } System.out.println(i) System.out.println System.out System System.out i break; String[] args args public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);

    for(int i = 2 ; i < 1000001 ; ++i){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    }
    
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);

    for(int i = 2 ; i < 1000001 ; ++i){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    }
    
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);

    for(int i = 2 ; i < 1000001 ; ++i){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3 + 1;
      }
      if(set.add(s)){
        set.add(s);
      }else{
        System.out.println(i);
        break;
      }
    }
    
  }
}