#!/usr/bin/python3
# CollatzConjecture.py
# La conjecture de Collatz

n = int(input("Entrez n0: "))
i = 0
while n != 1:  # on suppose que la conjecture est vraie
               # (sinon la boucle ne terminera jamais!)
    if n % 2 == 0:  # n pair:
        n /= 2      # remplacer n <- n/2
    else:           # n impair:
        n *= 3      # remplacer n <- 3n + 1
        n += 1
    i += 1
print("i =", i)
