//Java版代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNextInt()) {
int n = sc.nextInt();
int count = 0;
while (n != 1) {
if (n % 2 == 0) {
n = n / 2;
} else {
n = (3 * n + 1) / 2;
}
count++;
}
System.out.println(count);
}
}
}
#Python版代码
while True:
try:
n = int(input())
count = 0
while n != 1:
if n % 2 == 0:
n //= 2
else:
n = (3 * n + 1) // 2
count += 1
print(count)
except:
break

京公网安备 11010502036488号