import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Map<Integer, Integer> z = new HashMap<>();
    int i = 1;
    int tmp = s;
    
    while(true) {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    }
  }
}
//need to work on more about HashMap  import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Map<Integer, Integer> z = new HashMap<>();
    int i = 1;
    int tmp = s;
    
    while(true) {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Map<Integer, Integer> z = new HashMap<>();
    int i = 1;
    int tmp = s;
    
    while(true) {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Map<Integer, Integer> z = new HashMap<>();
    int i = 1;
    int tmp = s;
    
    while(true) {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc Map<Integer, Integer> z = new HashMap<>(); z new HashMap<>() int i = 1; i 1 int tmp = s; tmp s while(true) {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    } true {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    } z.put(i, tmp) z.put z i tmp if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      } tmp%2 == 0 tmp%2 tmp 2 0 {
        tmp = tmp/2;
      } tmp = tmp/2 tmp tmp/2 tmp 2 {
        tmp = 3*tmp+1;;
      } tmp = 3*tmp+1 tmp 3*tmp+1 3*tmp 3 tmp 1 if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      } z.containsValue(tmp) z.containsValue z tmp {
        System.out.println(i+1);
        break;
      } System.out.println(i+1) System.out.println System.out System System.out i+1 i 1 break; i++ i String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Map<Integer, Integer> z = new HashMap<>();
    int i = 1;
    int tmp = s;
    
    while(true) {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    }
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Map<Integer, Integer> z = new HashMap<>();
    int i = 1;
    int tmp = s;
    
    while(true) {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    }
  }
} Main
import java.util.*;
 
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Map<Integer, Integer> z = new HashMap<>();
    int i = 1;
    int tmp = s;
    
    while(true) {
      z.put(i, tmp);
      if(tmp%2 == 0) {
        tmp = tmp/2;
      } else {
        tmp = 3*tmp+1;;
      }
      
      if(z.containsValue(tmp)) {
        System.out.println(i+1);
        break;
      }
      i++;
    }
  }
}
//need to work on more about HashMap 