
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		int[] a = new int[1000000];
		int end = 0;
		int findex=0;
		int m = 100000;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		a[0]=Integer.parseInt(str);
		
		
		for(int i=0; i<a.length-1 ;i++){
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		}
		
		for(int i=0; i<m; i++){
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		}
		System.out.println(m+1);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Iterator; Iterator java.util public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		int[] a = new int[1000000];
		int end = 0;
		int findex=0;
		int m = 100000;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		a[0]=Integer.parseInt(str);
		
		
		for(int i=0; i<a.length-1 ;i++){
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		}
		
		for(int i=0; i<m; i++){
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		}
		System.out.println(m+1);
	}
} Main public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		int[] a = new int[1000000];
		int end = 0;
		int findex=0;
		int m = 100000;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		a[0]=Integer.parseInt(str);
		
		
		for(int i=0; i<a.length-1 ;i++){
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		}
		
		for(int i=0; i<m; i++){
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		}
		System.out.println(m+1);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		int[] a = new int[1000000];
		int end = 0;
		int findex=0;
		int m = 100000;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		a[0]=Integer.parseInt(str);
		
		
		for(int i=0; i<a.length-1 ;i++){
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		}
		
		for(int i=0; i<m; i++){
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		}
		System.out.println(m+1);
	} int[] a = new int[1000000]; a new int[1000000] 1000000 int end = 0; end 0 int findex=0; findex 0 int m = 100000; m 100000 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br a[0]=Integer.parseInt(str) a[0] a 0 Integer.parseInt(str) Integer.parseInt Integer str for(int i=0; i<a.length-1 ;i++){
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		} int i=0; int i=0; i 0 i<a.length-1 i a.length-1 a.length a a.length 1 i++ i++ i {
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		} {
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		} if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			} a[i]==1 a[i] a i 1 {
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			} end += 1 end 1 if(end==2){
					findex=i;
					break;
				} end==2 end 2 {
					findex=i;
					break;
				} findex=i findex i break; if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			} a[i]%2 == 0 a[i]%2 a[i] a i 2 0 {
				a[i+1]=a[i]/2;
			} a[i+1]=a[i]/2 a[i+1] a i+1 i 1 a[i]/2 a[i] a i 2 {
				a[i+1]=a[i]*3+1;
			} a[i+1]=a[i]*3+1 a[i+1] a i+1 i 1 a[i]*3+1 a[i]*3 a[i] a i 3 1 for(int i=0; i<m; i++){
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		} int i=0; int i=0; i 0 i<m i m i++ i++ i {
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		} {
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		} for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			} int j=i+1; int j=i+1; j i+1 i 1 j<m j m j++ j++ j {
				if (a[i]==a[j]){
					m = j;
				}
			} {
				if (a[i]==a[j]){
					m = j;
				}
			} if (a[i]==a[j]){
					m = j;
				} a[i]==a[j] a[i] a i a[j] a j {
					m = j;
				} m = j m j System.out.println(m+1) System.out.println System.out System System.out m+1 m 1 String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		int[] a = new int[1000000];
		int end = 0;
		int findex=0;
		int m = 100000;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		a[0]=Integer.parseInt(str);
		
		
		for(int i=0; i<a.length-1 ;i++){
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		}
		
		for(int i=0; i<m; i++){
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		}
		System.out.println(m+1);
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		int[] a = new int[1000000];
		int end = 0;
		int findex=0;
		int m = 100000;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		a[0]=Integer.parseInt(str);
		
		
		for(int i=0; i<a.length-1 ;i++){
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		}
		
		for(int i=0; i<m; i++){
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		}
		System.out.println(m+1);
	}
} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		int[] a = new int[1000000];
		int end = 0;
		int findex=0;
		int m = 100000;
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		a[0]=Integer.parseInt(str);
		
		
		for(int i=0; i<a.length-1 ;i++){
			if (a[i]==1){
				end += 1;
				if(end==2){
					findex=i;
					break;
				}
			}
			if (a[i]%2 == 0){
				a[i+1]=a[i]/2;
			}
			else {
				a[i+1]=a[i]*3+1;
			}
		}
		
		for(int i=0; i<m; i++){
			for(int j=i+1; j<m; j++){
				if (a[i]==a[j]){
					m = j;
				}
			}
		}
		System.out.println(m+1);
	}
}