DDeloitte | COGNIZANT | IBM | CAPGEMINIdef solve(s): for i in range(1, len(s)): s1, s2 = s[:i], s[i:] if s1.count('a') == len(s1) and s2.count('b') == len(s2): return True return False n=int(input()) ans=0 for _ in range(n): s=input() if solve(s): ans+=1 print(ans) #special string #wipro 1.1K · 04:48