__sunhy2012__ @ 2024-11-10 20:15:56
#include<bits/stdc++.h>
using namespace std;
char a,b;
int n,ans[1000001],cnt=1;
int main(){
while(cin>>a){
n++;
if(a==b) ans[cnt]++;
else ans[++cnt]++,b=a;
}
cout<<sqrt(n);
for(int i=1 ; i<=cnt; i++)
cout<<" "<<ans[i];
return 0;
}