import itertools as it import operator as op import functools as fn print(sum(map(all, map(fn.partial(map, fn.partial(op.eq, 'T')), map(fn.partial(map, op.itemgetter(1)), map(op.itemgetter(1), it.groupby(zip(it.chain.from_iterable(map(fn.partial(it.repeat, times=int(input())//10), it.count())), input()), op.itemgetter(0))))))))
1 2 3 4 5 | import itertools as it import operator as op import functools as fn print(sum(map(all, map(fn.partial(map, fn.partial(op.eq, 'T')), map(fn.partial(map, op.itemgetter(1)), map(op.itemgetter(1), it.groupby(zip(it.chain.from_iterable(map(fn.partial(it.repeat, times=int(input())//10), it.count())), input()), op.itemgetter(0)))))))) |