#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
using namespace std;
string f(long n)
{
	//long i,j;
	string s="";
	while(n>0)
	{
		s=char(n%10+'0')+s;
		n=n/10;
	}
	return s;
}
int main()
{
		freopen("input.txt","rt",stdin);
	freopen("output.txt","wt",stdout);
	//cout.setf(ios::fixed | ios::showpoint);
	//cout.precision(2);
	string in,out="";
	cin>>in;
	long i,j,k;
	for(i=0;i<in.size();i+=j)
	{
		for(j=0;in[i]==in[j+i];j++);
		out+=f(j)+in[i];
	}
	cout<<out;
	cin>>i;
	return 0;
}