program Nenxau;
var s: string;
i, count: integer;
c: char;
begin
readln(s);
count := 1;
c := s[1];
for i := 2 to length(s) do
begin
if s[i] = c then
inc(count)
else
begin
write(count);
write(c);
count := 1;
c := s[i];
end;
end;
write(count);
write(c);
end.