import sys import math n=int(input()) s=str(input()) now=[[False],0] for i in s: ***=[] for j in now: if (i.islower() and j[0]) or (i.isupper()) and not j[0] : ***.append([not j[0],j[1]+1])#用caps ***.append([j[0],j[1]+1])#用shift else: ***.append([j[0],j[1]]) ***.sort(key=lambda x:x[...