import java.util.*;

class Main{
  public static void main(String args[]){
  	Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int flag = 0;
    int[] a = new int[1000000];
	int answer = 1;
	a[s]++;
    while(flag == 0){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3+1;
      }
      a[s]++;
	  answer++;
      if(a[s] == 2){
        flag = 1;
      }
    }
    System.out.print(answer);
  }
} import java.util.*; util.* java class Main{
  public static void main(String args[]){
  	Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int flag = 0;
    int[] a = new int[1000000];
	int answer = 1;
	a[s]++;
    while(flag == 0){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3+1;
      }
      a[s]++;
	  answer++;
      if(a[s] == 2){
        flag = 1;
      }
    }
    System.out.print(answer);
  }
} Main public static void main(String args[]){
  	Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int flag = 0;
    int[] a = new int[1000000];
	int answer = 1;
	a[s]++;
    while(flag == 0){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3+1;
      }
      a[s]++;
	  answer++;
      if(a[s] == 2){
        flag = 1;
      }
    }
    System.out.print(answer);
  } main {
  	Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int flag = 0;
    int[] a = new int[1000000];
	int answer = 1;
	a[s]++;
    while(flag == 0){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3+1;
      }
      a[s]++;
	  answer++;
      if(a[s] == 2){
        flag = 1;
      }
    }
    System.out.print(answer);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int flag = 0; flag 0 int[] a = new int[1000000]; a new int[1000000] 1000000 int answer = 1; answer 1 a[s]++ a[s] a s while(flag == 0){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3+1;
      }
      a[s]++;
	  answer++;
      if(a[s] == 2){
        flag = 1;
      }
    } flag == 0 flag 0 {
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3+1;
      }
      a[s]++;
	  answer++;
      if(a[s] == 2){
        flag = 1;
      }
    } if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3+1;
      } s%2 == 0 s%2 s 2 0 {
        s = s/2;
      } s = s/2 s s/2 s 2 {
        s = s*3+1;
      } s = s*3+1 s s*3+1 s*3 s 3 1 a[s]++ a[s] a s answer++ answer if(a[s] == 2){
        flag = 1;
      } a[s] == 2 a[s] a s 2 {
        flag = 1;
      } flag = 1 flag 1 System.out.print(answer) System.out.print System.out System System.out answer String args[] args
import java.util.*;

class Main{
  public static void main(String args[]){
  	Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int flag = 0;
    int[] a = new int[1000000];
	int answer = 1;
	a[s]++;
    while(flag == 0){
      if(s%2 == 0){
        s = s/2;
      }else{
        s = s*3+1;
      }
      a[s]++;
	  answer++;
      if(a[s] == 2){
        flag = 1;
      }
    }
    System.out.print(answer);
  }
}
