#include <fstream>

using namespace std;

int stack[10000+1];
int h = 0;


int main () {
	ifstream in;
	in.open("input.txt");

	ofstream out;
	out.open("output.txt");

	char c, pred; int cnt = 0;

	in >> c; pred = c;
	while ( ! in.eof() ) {
		if(c==pred) cnt++;
		else {
			out << cnt << pred;
			pred = c;
			cnt = 1;
		}
		in >> c;
	}
	out << cnt << pred;
	pred = c;
	cnt = 1;

	in.close();
	out.close();
}