text: As in the sample test case, Roy was coding for 4 minutes at the end of Day 1 and he continued to code till 5 more minutes on Day 2.Hence the longest coding streak is 4+5 equals 9.There is no any other coding streak larger than this.So the longest coding streak of all days is 9.# Solution def main(): n = int(raw_input()) strings = [] string_streak = 0 total_streak = 0 for i in range(n): temp_string = raw_input() strings.append(temp_string) for string in strings: temp_string_streak = 0 temp_streak = 0 for char in string: if char == "E" or char == "S": if temp_streak > temp_string_streak: temp_string_streak = temp_streak temp_streak = 0 if char == "C": temp_streak += 1 if temp_streak > temp_string_streak: temp_string_streak = temp_streak if temp_string_streak > string_streak: string_streak = temp_string_streak total_string = "" for string in strings: total_string += string temp_streak = 0 for char in total_string: if char == "E" or char == "S": if temp_streak > total_streak: total_streak = temp_streak temp_streak = 0 if char == "C": temp_streak += 1 if temp_streak > total_streak: total_streak = temp_streak print str(string_streak) + " " + str(total_streak) if __name__ == "__main__": main()