#include <stdio.h>                                           //ÀîÃ÷Ç« 
#include <stdlib.h>
#define N 100000
struct Strange
{
    char *Letter;
    int counter, n;
}SS;

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