Recently Adaltik discovered japanese crosswords. Japanese crossword is a picture, represented as a table sized a × b squares, and each square is colored white or black. There are integers to the left of the rows and to the top of the columns, encrypting the corresponding row or column. The number of integers represents how many groups of black squares there are in corresponding row or column, and the integers themselves represents the number of consecutive black squares in corresponding group (you can find more detailed explanation in Wikipedia https://en.wikipedia.org/wiki/Japanese_crossword).

Adaltik decided that the general case of japanese crossword is too complicated and drew a row consisting of n squares (e.g. japanese crossword sized 1 × n), which he wants to encrypt in the same way as in japanese crossword. [Image] The example of encrypting of a single row of japanese crossword. 

Help Adaltik find the numbers encrypting the row he drew.


-----Input-----

The first line of the input contains a single integer n (1 ≤ n ≤ 100) — the length of the row. The second line of the input contains a single string consisting of n characters 'B' or 'W', ('B' corresponds to black square, 'W' — to white square in the row that Adaltik drew).


-----Output-----

The first line should contain a single integer k — the number of integers encrypting the row, e.g. the number of groups of black squares in the row.

The second line should contain k integers, encrypting the row, e.g. corresponding to sizes of groups of consecutive black squares in the order from left to right.


-----Examples-----
Input
3
BBW

Output
1
2 
Input
5
BWBWB

Output
3
1 1 1 
Input
4
WWWW

Output
0

Input
4
BBBB

Output
1
4 
Input
13
WBBBBWWBWBBBW

Output
3
4 1 3 


-----Note-----

The last sample case correspond to the picture in the statement.

Difficulty: interview

Starter code:

Solutions:
# You lost the game.

n = int(input())
s = str(input())

R = []
b = 0
for i in range(n):
    if s[i] == "B":
        b += 1
    elif b > 0:
        R += [b]
        b = 0
if b > 0:
    R += [b]
print(len(R))
for i in range(len(R)):
    print(R[i],end=" ")


#!/usr/bin/env python3

import re


def main():
    try:
        while True:
            input()
            a = list(map(len, [_f for _f in re.split(r"W+", input()) if _f]))
            print(len(a))
            print(*a)

    except EOFError:
        pass


main()


n = int(input())
s = input().rstrip()
a = []
k = 0
s += 'W'
for i in s:
    if i == 'B':
        k += 1
    else:
        if k > 0:
            a.append(k)
        k = 0
print(len(a))
print(' '.join(map(str, a)))

n = int(input())
s = input()
cur = 0
a = []
for elem in s:
    if elem == 'B':
        cur += 1
    else:
        if cur != 0:
            a.append(cur)
            cur = 0
if cur != 0:
    a.append(cur)
print(len(a))
print(' '.join(map(str, a)))


import re
n=int(input())
s=input()
l=re.findall('(B+)',s)
print(len(l))
for i in l:
	print(len(i),end=' ')


import sys, math
n = int(input())
z = input()
z += 'W'
ans = []
prev = 'W'
ctr = 0
for i in z:
    if i == 'B':
        if prev == 'W':
            ctr = 1
        else:
            ctr += 1
    else:
        if prev == 'B':
            ans.append(ctr)
    prev = i
print(len(ans))
print(*ans)


n = int(input())
s = input()
curr_b = 0
ans = []
for i in range(n):
    if s[i] == 'B':
        curr_b += 1
        if i == n - 1:
            ans.append(curr_b)
    else:
        if i > 0 and s[i - 1] == 'B':
            ans.append(curr_b)
        curr_b = 0
print(len(ans))
for i in ans:
    print(i, end = " ")

n = int(input())
s = input()
a = []
cur = 0
for i in s:
    if i == 'B':
        cur += 1
    elif cur:
        a.append(cur)
        cur = 0
if cur:
    a.append(cur)
print(len(a))
print(*a)


input()
s = input()
l = []
count = 0
for c in range(len(s)):
	if s[c]=='B':
		count += 1
	else:
		if c and s[c-1]=='B':
			l.append(count)
			count = 0
if count:
	l.append(count)
print(len(l))
for i in l:
	print(i)


n, s = int(input()), input()
cnt = [0]
for c in s:
    if c == 'B':
        cnt[-1] += 1
    elif cnt[-1]:
        cnt.append(0)
if not cnt[-1]:
    cnt.pop()
print(len(cnt))
print(*cnt)


from sys import stdin

n = int(stdin.readline())

s = stdin.readline().strip().split('W')

s = [block for block in s if block != '']

print(len(s))

for block in s:
    print(len(block), end=' ')
if s:
    print()


n=int(input())
s=input()
s=s+"W"
l=[]
q=0
for i in range(len(s)):
    if s[i]=="B":
        q=q+1
    else:
        if q!=0:
            l.append(q)
        q=0
print(len(l))
for i in range(len(l)):
    print(str(l[i])+" ",end="")



input()
s = input()

res = []
counter = 0

for c in s:
    if c == 'B':
        counter += 1
    elif c == 'W':
        if counter > 0:
            res.append(counter)
        counter = 0

if counter > 0:
    res.append(counter)

print(len(res))
for r in res:
    print(r, end=' ')
print()


n = int(input())
arr = input().split('W')
for i in range(arr.count('')):
    arr.remove('')
print(len(arr))
if(len(arr)):
    s = ''
    for x in arr:
        s += str(len(x))+' '
    print(s)

n = int(input())
a = input()
dp = [0] * n
for i in range(n):
    if (a[i] == 'W'):
        dp[i] = 0
    else:
        dp[i] = dp[i - 1] + 1
dp += [0]
ans = []
for i in range(n):
    if (dp[i] != 0 and dp[i + 1] == 0):
        ans.append(dp[i])
print(len(ans))
print(*ans)

n = int(input())
c = 0
s = input()
ans = ''
ans_n = 0
for i in range(n):
    if s[i] == "B":
        c+=1
        
    else:
        if c != 0:
            ans+=str(c) + ' '
            ans_n+=1
        c = 0
if c != 0:
    ans+=str(c) + ' '
    ans_n+=1        

print(ans_n)
print(ans)

n = int(input())
s = input()
a = []
c = 0
for i in range(len(s)):
    if s[i]=="B":
        c+=1
    else:
        if c > 0:
            a.append(c)
        c = 0

if c!= 0:
    a.append(c)
print(len(a))
for x in a:
    print(x,end=" ")



n = int(input())
a = "W"+input()+"W"
count = 0
lst = []
for ch in a:
  if ch == "B": count += 1
  elif count:
    lst.append(count)
    count = 0
print(len(lst))
print(" ".join(map(str, lst)))


input()
sl = []
k = 0
for cell in input():
    if cell == 'B':
        k += 1
    else:
        if k > 0:
            sl.append(str(k))
        k = 0
if k > 0:
    sl.append(str(k))

print(len(sl))
print(" ".join(sl))


# put your current running code in here

n = int(input())
s = list(input())

gr_lg = []
i = 0
while i < len(s):
    gr_cnt = 0
    while i < len(s) and s[i] == 'B':
        gr_cnt += 1
        i += 1
    if gr_cnt > 0:
        gr_lg.append(gr_cnt)
    i += 1

print(len(gr_lg))
for lg in gr_lg:
    print(lg, end=" ")


input()

s2 = []
for el in [len(el) for el in input().strip().split('W')]:
    if el > 0: s2.append(str(el))

print(len(s2))
print(' '.join(s2))

n = int(input())
ans = []
cnt = 0
for i in input().strip():
    if (i == 'W' and cnt):
        ans.append(cnt)
        cnt = 0
    elif (i == 'B'):
        cnt += 1
if (cnt):
    ans.append(cnt)
    cnt = 0
print(len(ans))
print(*ans)


def getin():
    xin = input()
    while xin.strip() == "":
        xin = input()
    return xin

def gi():
    return [int(x) for x in getin().split()]

input()

s = input()
ch = s[0]
i = 1
cur = 1 if ch == 'B' else 0
ans = []
while i < len(s):
    if s[i] == 'B':
        if ch == 'B':
            cur += 1
        else:
            cur = 1
    elif s[i] == 'W':
        if ch == 'B':
            ans.append(cur)
        cur = 0
    ch = s[i]
    i += 1
if cur > 0:
    ans.append(cur)

print(len(ans))
if len(ans) > 0:
    print(" ".join([str(x) for x in ans]))


n = input()
s = input().split('W')
n = 0
res = ''
for i in s:
    if len(i) > 0:
        n += 1
        res += "{} ".format(len(i))
print(n)
if res:
    print(res)


n = int(input())
s = str(input())

blocks = 0
current_size = 0
sizes = []

last = ""
for i in range(n):
    if i == 0 and s[i] == "B":
        blocks += 1
        current_size += 1
    else:
        if s[i] == "B":
            if last == "B":
                current_size += 1
            else:
                blocks += 1
                current_size = 1
        else:
            if last == "B":
                sizes.append(current_size)
    last = s[i]

if len(sizes) != blocks:
    sizes.append(current_size)

print(blocks)
if blocks != 0:
    print(*sizes)