import re str1=open('24_1.txt').read() result=re.findall(r'B*',str1) print(max(list(map(len,result))))