import sys from collections import Counter seasonstreaks = Counter() date = '' for line in sys.stdin: if line.startswith('info,date'): date = line if not line.startswith('play'): continue pickoffcount = 0 pitches = line.split(',')[5] for p in pitches: # + following pickoff throw by the catcher # * indicates the following pitch was blocked by the catcher # . marker for play not involving the batter # 1 pickoff throw to first # 2 pickoff throw to second # 3 pickoff throw to third # > Indicates a runner going on the pitch if p in '123': pickoffcount += 1 elif p in '+*.>': pass elif pickoffcount > 0: if pickoffcount >= 7: print(f"{pickoffcount} pickoffs on {date}") print(line) seasonstreaks[pickoffcount] += 1 pickoffcount = 0 print(seasonstreaks)