heads = 8188 coup = 0 while heads > 0: coup = coup + 1 heads = heads // 2 if heads%2 != 0 and heads > 1: heads = heads * 3 + 1 print(coup)