Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = input()
cnt = 0
while True:
    c = a.count("BW")
    a = a.replace("BW","WB")
    if c != 0:
        cnt += c
    else:
        print(cnt)
        sys.exit(0)

Fixed submission:
import sys
a = [ c for c in input()]
B = 0
W = 0
for i in range(len(a)):
    if a[i] == "B":
        B += 1
    else:
        W += B

print(W)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = input()
S = [s for s in a]

cnt = 0
while True:
    b = a
    c = a.count("BW")
    a = a.replace("BW","WB")
    if c != 0:
        cnt += c
    else:
        print(cnt)
        sys.exit(0)

Fixed submission:
import sys
a = [ c for c in input()]
B = 0
W = 0
for i in range(len(a)):
    if a[i] == "B":
        B += 1
    else:
        W += B

print(W)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = input()
S = [s for s in a]
# #print(l)

cnt = 0
while True:
    b = a
    a = a.replace("BW","WB",1)
    if b != a:
        cnt += 1
    else:
        print(cnt)
        sys.exit(0)

Fixed submission:
import sys
a = [ c for c in input()]
B = 0
W = 0
for i in range(len(a)):
    if a[i] == "B":
        B += 1
    else:
        W += B

print(W)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = input()
S = [s for s in a]
# #print(l)

cnt = 0
while True:
    b = a
    a = a.replace("BW","WB",1)
    if b != a:
        cnt += 1
    else:
        print(cnt)
        sys.exit(0)

Fixed submission:
import sys
a = [ c for c in input()]
B = 0
W = 0
for i in range(len(a)):
    if a[i] == "B":
        B += 1
    else:
        W += B

print(W)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = input()
S = [s for s in a]
#print(l)

#BWを探してWBに書き換える。
cnt = 0
while True:
    b = False
    for i in range(len(a)-1):    
        if S[i] == "B" and S[i+1] == "W":
            S[i] = "W"
            S[i+1] = "B"
            cnt += 1
            b = True
    if b == False:
        print(cnt)
        sys.exit(0)

Fixed submission:
import sys
a = [ c for c in input()]
B = 0
W = 0
for i in range(len(a)):
    if a[i] == "B":
        B += 1
    else:
        W += B

print(W)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = input()
S = [s for s in a]
#print(l)

#BWを探してWBに書き換える。
cnt = 0
while True:
    b = False
    for i in range(len(a)-1):    
        if S[i] == "B" and S[i+1] == "W":
            S[i] = "W"
            S[i+1] = "B"
            cnt += 1
            b = True
            break
    if b == False:
        print(cnt)
        sys.exit(0)

Fixed submission:
import sys
a = [ c for c in input()]
B = 0
W = 0
for i in range(len(a)):
    if a[i] == "B":
        B += 1
    else:
        W += B

print(W)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
a = input()
S = [s for s in a]
#print(l)

#BWを探してWBに書き換える。
cnt = 0
while True:
    b = False
    for i in range(len(a)-1):    
        if S[i] == "B" and S[i+1] == "W":
            S[i] = "W"
            S[i+1] = "B"
            cnt += 1
            b = True
            break
    if b == False:
        print(cnt)
        sys.exit(0)

Fixed submission:
import sys
a = [ c for c in input()]
B = 0
W = 0
for i in range(len(a)):
    if a[i] == "B":
        B += 1
    else:
        W += B

print(W)