def solution(num):
    count = 0

    for i in range(500):
        if num == 1:
            break

        if num % 2 == 0:
            num /= 2
            count += 1
        else:
            num = (num * 3) + 1
            count += 1
    if count == 500:
        count = -1

    return count