#include <iostream>
using namespace std;

int main() 
{
    int i=0;
    string a;
    cin>>a;
    int len=a.size();
    string ans;
    for(i=0;i<len;i++)
    {
        if(i+1<len)
        {
            if(a[i]==a[i+1])
            {
                char b=a[i];
                int count=0;
                while(i<len  && a[i]==b)
                {
                    count++;
                    i++;
                }
                ans+=to_string (count);
                ans+=b;
                i--;
            }
            else 
            {
                ans+='1';
                ans+=a[i];
            }
        }
        else 
        {
            ans+='1';
            ans+=a[i];
        }
    }
    cout<<ans;
    return 0;
}