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

public class taskB {
	
	// Stepanov Iliya
	
	Scanner in;
	PrintWriter out;
	
	void solve() {
		char[] a = in.next().toCharArray();
		char curChar = a[0];
		int charCnt = 1;
		//boolean allEquals = true;
		for (int i = 1; i < a.length; i++) {
			if (a[i] != curChar) {
				out.print(charCnt);
				out.print(curChar);
				//out.println("cnt = " + charCnt);
				//out.println("char = " + curChar);
				curChar = a[i];
				charCnt = 1;
				//allEquals = false;
			} else {
				charCnt++;
			}
		}
		//if (allEquals) {
		//	charCnt--;
		//}
		out.print(charCnt);
		out.print(curChar);
	}
	
	void run() {
		try {
			in = new Scanner(new FileReader("input.txt"));
			out = new PrintWriter("output.txt");
		} catch (Exception e) {
			in = new Scanner(System.in);
			out = new PrintWriter(System.out);
		}
		try {
			solve();
		} finally {
			out.close();
		}
	}
	
	public static void main (String args[]) {
		new taskB().run();
	}
}