#include <stdio.h>
#define N 100000

int main()
{
    int i, counter = 1, n = 0;
    char c;
    char Letter[N];
    char *Crt = Letter;
    gets(Crt);
    for (i = 0;Letter[i] != '\0';i++)
    {
        n++;
    }
    for (i = 0;i <= n - 1;i++)
    {
        if (Letter[i] == Letter[i+1])
        {
            counter++;
        }
        else
        {
            printf("%d%c", counter, Letter[i]);
            counter = 1;
        }
    }
}
