import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    List<Integer> list = new ArrayList<>();
    int a = s;
    list.add(a);
    while(true){
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    }
  }
  
  public static int func(int a){
    if(a % 2 == 0){
      return a / 2;
    }else{
      return 3 * a + 1;
    }
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    List<Integer> list = new ArrayList<>();
    int a = s;
    list.add(a);
    while(true){
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    }
  }
  
  public static int func(int a){
    if(a % 2 == 0){
      return a / 2;
    }else{
      return 3 * a + 1;
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    List<Integer> list = new ArrayList<>();
    int a = s;
    list.add(a);
    while(true){
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    List<Integer> list = new ArrayList<>();
    int a = s;
    list.add(a);
    while(true){
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc List<Integer> list = new ArrayList<>(); list new ArrayList<>() int a = s; a s list.add(a) list.add list a while(true){
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    } true {
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    } if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      } list.contains(func(a)) list.contains list func(a) func a {
        System.out.println(list.size() + 1);
        break;
      } System.out.println(list.size() + 1) System.out.println System.out System System.out list.size() + 1 list.size() list.size list 1 break; a = func(a) a func(a) func a list.add(a) list.add list a String[] args args public static int func(int a){
    if(a % 2 == 0){
      return a / 2;
    }else{
      return 3 * a + 1;
    }
  } func {
    if(a % 2 == 0){
      return a / 2;
    }else{
      return 3 * a + 1;
    }
  } if(a % 2 == 0){
      return a / 2;
    }else{
      return 3 * a + 1;
    } a % 2 == 0 a % 2 a 2 0 {
      return a / 2;
    } return a / 2; a / 2 a 2 {
      return 3 * a + 1;
    } return 3 * a + 1; 3 * a + 1 3 * a 3 a 1 int a a public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    List<Integer> list = new ArrayList<>();
    int a = s;
    list.add(a);
    while(true){
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    }
  }
  
  public static int func(int a){
    if(a % 2 == 0){
      return a / 2;
    }else{
      return 3 * a + 1;
    }
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    List<Integer> list = new ArrayList<>();
    int a = s;
    list.add(a);
    while(true){
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    }
  }
  
  public static int func(int a){
    if(a % 2 == 0){
      return a / 2;
    }else{
      return 3 * a + 1;
    }
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    List<Integer> list = new ArrayList<>();
    int a = s;
    list.add(a);
    while(true){
      if(list.contains(func(a))){
        System.out.println(list.size() + 1);
        break;
      }
      a = func(a);
      list.add(a);
    }
  }
  
  public static int func(int a){
    if(a % 2 == 0){
      return a / 2;
    }else{
      return 3 * a + 1;
    }
  }
}