# part 1 print(max([ sum([int(z) for z in x]) for x in [x.split('\n') for x in open('in.txt', 'r').read().split('\n\n') ]])) # part 2 print(sum(sorted([ sum([int(z) for z in x]) for x in [x.split('\n') for x in open('in.txt', 'r').read().split('\n\n')]], reverse=True)[0:3]))