import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    }
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    }
  } main {
    Scanner sc = new Scanner(System.in);
    try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    } {
      sc.close();
    } sc.close() sc.close sc {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } boolean[] seen = new boolean[1000000]; seen new boolean[1000000] 1000000 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int i = 1; i 1 seen[n] = true seen[n] seen n true while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      } true {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      } if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        } n % 2 == 0 n % 2 n 2 0 {
          n /= 2;
        } n /= 2 n 2 {
          n = 3 * n + 1;
        } n = 3 * n + 1 n 3 * n + 1 3 * n 3 n 1 i++ i if (seen[n]) {
          System.out.println(i);
          return;
        } seen[n] seen n {
          System.out.println(i);
          return;
        } System.out.println(i) System.out.println System.out System System.out i return; seen[n] = true seen[n] seen n true String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    }
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    try {
      boolean[] seen = new boolean[1000000];
      int n = sc.nextInt();
      int i = 1;
      seen[n] = true;

      while(true) {
        if (n % 2 == 0) {
          n /= 2;
        } else {
          n = 3 * n + 1;
        }
        i++;
        if (seen[n]) {
          System.out.println(i);
          return;
        }
        seen[n] = true;
      }
    } finally {
      sc.close();
    }
  }
}
