fork download
  1. import sys
  2.  
  3. before = input()
  4. now = before
  5. cycle = 0
  6.  
  7. while True:
  8. cycle += 1
  9. if(len(now) == 1):
  10. now = '0' + now
  11. before = now
  12. now = now[-1] + (str(int(now[0]) + int(now[1])))[-1]
  13. if(now == before):
  14. print(cycle)
  15. break
Success #stdin #stdout 0.02s 9128KB
stdin
55
stdout
3