#include <iostream>
#include <cassert>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <fstream>

using namespace std;

int main() {
	string line;
	while( getline( cin, line ) ) {
		string res;
		for( int i = 0; i < line.size(); ) {
			if( i+1 < line.size() && line[i] == line[i+1] ) {
				int cnt = 1;
				while( cnt < 9 && i+cnt < line.size() && line[i+cnt] == line[i] ) cnt++;
				res += '0' + cnt;
				res += line[i];
				i += cnt;
			}
			else {
				res += '1';
				while( i < line.size() && ( i+1 >= line.size() || line[i] != line[i+1] ) ) {
					res += line[i];
					if( line[i] == '1' ) res += '1';
					i++;
				}
				res += '1';
			}
		}
		cout << res << endl;
	}
	return 0;
}
