#include <bits/stdc++.h>
using namespace std;
int a[40001],cnt,temp;
int main(){
char c;
while(cin >> c){
a[++cnt] = c - '0';
}
int d = a[1];
int n = sqrt(cnt);
cout << n << " ";
for(int i = 1; i <= cnt; i++){
if(a[i] == d){
temp++;
}else{
cout << temp << " ";
d = !d;
temp = 1;
}
if(i == cnt){
cout << temp;
}
}
return 0;
}