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