import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int s = scanner.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);
    for (int i = 2; i <= 1000000; i++) {
      s = f(s);
      if (set.contains(s)) {
        System.out.println(i);
        return;
      }
      set.add(s);
    }
  }

  private static int f(int n) {
    if (n % 2 == 0) return n/2;
    return 3 * n + 1;
  }
} import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int s = scanner.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);
    for (int i = 2; i <= 1000000; i++) {
      s = f(s);
      if (set.contains(s)) {
        System.out.println(i);
        return;
      }
      set.add(s);
    }
  }

  private static int f(int n) {
    if (n % 2 == 0) return n/2;
    return 3 * n + 1;
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int s = scanner.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);
    for (int i = 2; i <= 1000000; i++) {
      s = f(s);
      if (set.contains(s)) {
        System.out.println(i);
        return;
      }
      set.add(s);
    }
  } main {
    Scanner scanner = new Scanner(System.in);

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

    int s = scanner.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);
    for (int i = 2; i <= 1000000; i++) {
      s = f(s);
      if (set.contains(s)) {
        System.out.println(i);
        return;
      }
      set.add(s);
    }
  }

  private static int f(int n) {
    if (n % 2 == 0) return n/2;
    return 3 * n + 1;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int s = scanner.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);
    for (int i = 2; i <= 1000000; i++) {
      s = f(s);
      if (set.contains(s)) {
        System.out.println(i);
        return;
      }
      set.add(s);
    }
  }

  private static int f(int n) {
    if (n % 2 == 0) return n/2;
    return 3 * n + 1;
  }
} Main
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int s = scanner.nextInt();
    Set<Integer> set = new HashSet<>();
    set.add(s);
    for (int i = 2; i <= 1000000; i++) {
      s = f(s);
      if (set.contains(s)) {
        System.out.println(i);
        return;
      }
      set.add(s);
    }
  }

  private static int f(int n) {
    if (n % 2 == 0) return n/2;
    return 3 * n + 1;
  }
}
