#include <bits/stdc++.h>
using namespace std;
int main() {
int a[40010], x = 0, cnt = 0;
string s;
bool flag = 1;
int t = 0;
while (cin >> s) {
x += s.length();
for (int i = 0; i < s.length(); i++) {
a[i + 1 + t] = s[i] - 48;
}
t += s.length();
}
cout << sqrt(x) << " ";
int tmp = a[1];
for (int i = 1; i <= x; i++) {
cnt++;
if (a[i] != tmp) {
tmp = a[i];
cout << cnt << " ";
cnt = 0;
}
if (i == x && a[i] == tmp) {
cout << cnt + 1;
}
}
return 0;
}
10分hhh