#include <stdio.h>
#include <ctype.h>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
	char ch, prev = 0;
	int count = 0;
	while( scanf("%c", &ch) == 1 )
	{
		if( ch != prev )
		{
			if( prev != 0 )
			{
				printf("%d%c", count, prev);
			}
			prev = ch;
			count = 0;
		}
		count ++;
	}
	printf("%d%c", count, prev);
	return 0;
}