#include<iostream>
#include<stdio.h>
#include <stdlib.h>
using namespace std;


int main()
{
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	
	char tmp;
	cin.get(tmp);
	int n=0, mass[1002];
	
	for(int i=0;i<1002;i++)
	{mass[i]=22;}	

	while(tmp!='\n')
	{	if(tmp=='-')
		{
			cin.get(tmp);
			mass[n++]=-(int(tmp)-'0');
			cin.get(tmp);
		}
		else
		{
		mass[n++]=int(tmp)-'0';
		cin.get(tmp);
		}
	}
	

	

	
	//cout<<n;
	//cout<<mass[0]<<mass[1]<<mass[2]<<mass[3];
	int k=1, m=0, res[1002];
	for(int i=0;i<n;i++)
	{
		if(mass[i]==mass[i+1])
		{
			k++;
			res[m]=k;
			res[m+1]=mass[i];
		}
		else 
		{
			
			res[m]=k;
			res[m+1]=mass[i];
			k=1;
			m+=2;
			
		}

			
	}



	//cout<<m<<"\n";
	for(int i=0;i<m;i++)
		cout<<res[i];
	


	
}
