// 
#pragma comment(linker, "/STACK:16777215")
#include <cmath>
#include <cstring>
#include <ctime>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <deque>
#include <string>
using namespace std;


int main()
{
	int i, j, k;
	string str;
	char t, pt=0;
	int  cnt=0;
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	cin >> str;
	for(i=0; i<str.size(); ++i)
	{
		t= str[i];
		if (pt!=t)
		{
			if (cnt!=0)
			{
				cout <<  (int)cnt << (char)pt;
			}
			cnt= 1;
			pt= t;
		}
		else
		{
			cnt++;
		}
	}
	if (cnt!=0)
	{
		cout << (int)cnt << (char)pt;
	}
	return 0;
}