import java.io.*;
import java.util.*;

public class Main {

	Scanner in;
	PrintWriter out;

	void solve() {
		char c[] = in.next().toCharArray();
		for (int i = 0; i < c.length; i++) {
			char ch = c[i];
			int count = 0;
			while (c[i] == ch) {
				count++;
				if (i < c.length - 1) {
					i++;
				} else {
					i++;
					break;
				}
			}
			i--;

			out.print(count);
			out.print(ch);
		}
	}

	void run() {
		try {
			in = new Scanner(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		} catch (IOException e) {
			throw new Error(e);
		}
		try {
			solve();
		} finally {
			out.close();
		}
	}

	public static void main(String args[]) {
		new Main().run();
	}

}
