#include<bits/stdc++.h>
using namespace std;
string str_comp(string a)
{
string temp; \Temp string to store new string
int prev=0, curr, count = 1;
char ch ;
stringstream ss;
for(curr=1; curr<a.size(); ++curr)
{
if(a[curr] == a[prev])
{
count++;
}
else
{
ss<<count;
ss>>ch;
temp+=a[prev];
temp+=ch;
prev = curr;
count = 1;
}
}
temp+=a[prev];
ss<<count;
ss>>ch;
temp+=ch;
return temp;
}
int main() {
string str;
string ans;
//Taking the string as input from the user
getline(cin,str);
ans = str_comp(str); //Calling the string compress fun
cout<<ans;
return 0;
}