#include <bits/stdc++.h>
using namespace std;
int main()
{
char a[4005],t;
long long y=1;
while(cin>>t)
{
if(t=='0'||t=='1'){
a[y++]=t;
}
}
y--;
long long x=1;
cout<<sqrt(y)<<' ';
char jh='0';
y++;
while(x<y){
long long cnt=0;
while(a[x]==jh){
cnt++;
x++;
if(x>y)break;
}
cout<<cnt<<' ';
if(jh=='0')jh='1';
else jh='0';
}
return 0;
}