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<>();
    
    // i = 1
    int prev = s;
    set.add(s);

    int i = 2;
    while (true) {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    }
  }
} 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<>();
    
    // i = 1
    int prev = s;
    set.add(s);

    int i = 2;
    while (true) {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    
    // i = 1
    int prev = s;
    set.add(s);

    int i = 2;
    while (true) {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    
    // i = 1
    int prev = s;
    set.add(s);

    int i = 2;
    while (true) {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    }
  } 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<>() int prev = s; prev s set.add(s) set.add set s int i = 2; i 2 while (true) {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    } true {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    } int v = prev%2 == 0 ? prev/2 : 3*prev+1; v prev%2 == 0 ? prev/2 : 3*prev+1 prev%2 == 0 prev%2 prev 2 0 prev/2 prev 2 3*prev+1 3*prev 3 prev 1 if (set.contains(v)) {
        System.out.println(i);
        return;
      } set.contains(v) set.contains set v {
        System.out.println(i);
        return;
      } System.out.println(i) System.out.println System.out System System.out i return; set.add(v) set.add set v prev = v prev v i++ i 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<>();
    
    // i = 1
    int prev = s;
    set.add(s);

    int i = 2;
    while (true) {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    }
  }
} public class Main {
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    Set<Integer> set = new HashSet<>();
    
    // i = 1
    int prev = s;
    set.add(s);

    int i = 2;
    while (true) {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    }
  }
} 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<>();
    
    // i = 1
    int prev = s;
    set.add(s);

    int i = 2;
    while (true) {
      int v = prev%2 == 0 ? prev/2 : 3*prev+1;
      if (set.contains(v)) {
        System.out.println(i);
        return;
      }
      set.add(v);
      prev = v;
      i++;
    }
  }
}