mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
38 lines
633 B
Python
38 lines
633 B
Python
def problem_p03200(input_data):
|
|
import sys
|
|
|
|
sys.setrecursionlimit(10**6)
|
|
|
|
if sys.platform in (["ios", "darwin", "win32"]):
|
|
|
|
sys.stdin = open("Untitled.txt")
|
|
|
|
input = sys.stdin.readline
|
|
|
|
def INT():
|
|
return int(eval(input_data))
|
|
|
|
def MAP():
|
|
return [int(s) for s in input_data.split()]
|
|
|
|
def main():
|
|
|
|
S = input_data.rstrip()
|
|
|
|
bcnt = 0
|
|
|
|
A = []
|
|
|
|
for i in range(len(S)):
|
|
|
|
if S[i] == "B":
|
|
bcnt += 1
|
|
|
|
if S[i] == "W":
|
|
A.append(bcnt)
|
|
|
|
return sum(A)
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|