k=int(input())
alp=list(map(str,input()))
A={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}#判斷大小寫用
cl=0
sl=0
alp_num=[]
j=-1
#大小寫取其數量並分段
for i in alp:
if i in A:
cl+=1
if j==0: alp_num.append(sl)
j=1
sl=0
else:
sl+=1
if j==1: alp_num.append(cl)
j=0
cl=0
if j==0: alp_num.append(sl)
else: alp_num.append(cl)