#include <stdio.h>
void pack_string(char s[]) {
if (s[0] == '.') {
return;
}
int time = 0;
char c;
for (int i = 0; s[i] != '.'; i++) {
time++;
c = s[i];
}
if (time == 1) {
printf("%c1",s[0]);
return;
}
int A[time], m = 0;
for(int i = 0; i< time; i++) {
A[i] = 1;
}
char B[time];
for (int i = 1; i < time; i++) {
if(s[i-1] == s[i]) {
A[m]++;
B[m] = s[i-1];
} else {
B[m]= s[i-1];
m++;
}
}
B[m] = c;
for(int i =0 ; i < m+1; i++) {
printf("%c%d", B[i], A[i]);
}
return;
}
int main() {
char a[1000];
scanf("%s", a);
pack_string(a);
return 0;
}