import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        if(sc.hasNext()){
            String s = sc.nextLine();
            char p = s.charAt(0);
            int cnt = 0;
            StringBuilder str;
            str = new StringBuilder();
            for(int i = 0; i < s.length(); i++){
                if(s.charAt(i) == p){
                    cnt++;
                }else{
                    str.append(cnt).append(p);
                    p = s.charAt(i);
                    cnt = 1;
                }
            }
            str.append(cnt).append(p);
            System.out.println(str);
        }
    }
}