fork(16) download
  1. def main():
  2.  
  3. case = str(raw_input())
  4. maxInt = 0
  5. current = ""
  6. cInt = ["1","2","3","4","5","6","7","8","9","0"]
  7. LetterUse = False
  8. index = 0
  9. for letter in case:
  10.  
  11. if(letter not in cInt): ## is a character
  12. if(LetterUse == True):
  13. if(case[index-1] in cInt): ## previous element was a number
  14. current=case[index-1] + "9"
  15. else: ## prev index not a number start from scratch
  16. current = "9"
  17. LetterUse = False
  18. else:
  19. current = current+"9"
  20. LetterUse = True
  21. else:
  22. current+=letter
  23. #print current
  24. if(int(current) > maxInt):
  25. maxInt = int(current)
  26. index+=1
  27. print maxInt
  28.  
  29. main()
Success #stdin #stdout 0.01s 7732KB
stdin
DDD
stdout
99