import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long s = sc.nextLong();
    ArrayList<Long> list = new ArrayList<Long>();
    list.add(s);
    int ans = 0;
    for(int i = 1; i <= 1000000; i++) {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    }
    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long s = sc.nextLong();
    ArrayList<Long> list = new ArrayList<Long>();
    list.add(s);
    int ans = 0;
    for(int i = 1; i <= 1000000; i++) {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    }
    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long s = sc.nextLong();
    ArrayList<Long> list = new ArrayList<Long>();
    list.add(s);
    int ans = 0;
    for(int i = 1; i <= 1000000; i++) {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    long s = sc.nextLong();
    ArrayList<Long> list = new ArrayList<Long>();
    list.add(s);
    int ans = 0;
    for(int i = 1; i <= 1000000; i++) {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    }
    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long s = sc.nextLong(); s sc.nextLong() sc.nextLong sc ArrayList<Long> list = new ArrayList<Long>(); list new ArrayList<Long>() list.add(s) list.add list s int ans = 0; ans 0 for(int i = 1; i <= 1000000; i++) {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    } int i = 1; int i = 1; i 1 i <= 1000000 i 1000000 i++ i++ i {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    } {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    } if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      } (s % 2) == 0 (s % 2) s 2 0 {
        s /= 2;
      } s /= 2 s 2 {
        s = 3 * s + 1;
      } s = 3 * s + 1 s 3 * s + 1 3 * s 3 s 1 if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      } list.contains(s) list.contains list s {
        ans = i + 1;
        break; 
      } ans = i + 1 ans i + 1 i 1 break; {
        list.add(s);
      } list.add(s) list.add list s System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long s = sc.nextLong();
    ArrayList<Long> list = new ArrayList<Long>();
    list.add(s);
    int ans = 0;
    for(int i = 1; i <= 1000000; i++) {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    }
    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long s = sc.nextLong();
    ArrayList<Long> list = new ArrayList<Long>();
    list.add(s);
    int ans = 0;
    for(int i = 1; i <= 1000000; i++) {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    }
    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long s = sc.nextLong();
    ArrayList<Long> list = new ArrayList<Long>();
    list.add(s);
    int ans = 0;
    for(int i = 1; i <= 1000000; i++) {
      if((s % 2) == 0) {
        s /= 2;
      } else {
        s = 3 * s + 1;
      }
      if(list.contains(s)) {
        ans = i + 1;
        break; 
      } else {
        list.add(s);
      }
    }
    System.out.println(ans);
  }
}