#include<bits/stdc++.h>
using namespace std;
string tostring(int n){
if(n==0) return "0";
string s;
while(n){
s+=n%10+48;
n/=10;
}
reverse(s.begin(),s.end());
return s;
}
int main(){
int n,cnt=0;
char a,s='0';
string ans;
while(cin>>a){
if(a!=s){
ans+=" "+tostring(cnt);
cnt=0;
s=a;
}
cnt++;
n++;
}
ans+=" "+tostring(cnt);
cout<<(int)sqrt(n)<<ans;
return 0;
}