contestada

The Hailstone sequence is computed as follows:
Start with an integer number n
If n is even, the next number in the sequence is n/2
If n is odd, the next number is 3n+1
Continue until it reaches 1

Write a Java program HailStone that on input a positive integer n, prints the length of the Hailstone sequence starting at n.

Test case
Input:
3
Output:
8