#include <bits/stdc++.h>
using namespace std;
int main(){
    char a[256];
    gets(a);
    int i,x=0;
    for(i=0;i<strlen(a);i++){
        x++;
        if(a[i]!=a[i+1]){
            if(x!=1)
                cout<<x;
            cout<<a[i];
            x=0;
        }       
         
    }
     
    return 0;
    }
/**************************************************************
	Problem: 1103
	User: wuyichen
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/