import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

public class main {
	public static void main(String[] args) throws FileNotFoundException {
		Scanner in = new Scanner(new File("input.txt"));
		PrintWriter out = new PrintWriter(new File("output.txt"));
		String s = in.nextLine();
		char ch = s.charAt(0); int c = 1;
		for (int i=1;i<s.length();i++) {
			if (s.charAt(i) == ch) c++; else
			{
				out.print(c+""+ch);
						ch = s.charAt(i);
				c = 1;
			}
		}
		out.print(c+""+ch);
		in.close();
		out.flush();
		out.close();
	}
}