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

public class Main {
	Scanner in;
	PrintWriter out;

	void solve(){
		String s=in.nextLine();
		int i=0;
		while(i<s.length()){
			int k=0;
			char c=s.charAt(i);
			while(i<s.length() && c==s.charAt(i)){
				i++;
				k++;
			}
			out.print(k + "" + c);
		}
		out.println();
	}
	
	void run(){
		try {
			in=new Scanner(new FileReader("input.txt"));
			out=new PrintWriter("output.txt");
		}catch (Exception e) {
			throw new Error();
		}
		solve();
		out.close();
	}
	
	public static void main(String args[]){
		new Main().run();
	}
}
