import java.util.Scanner;
public class Main {

    public static String getCountString(String str){
        if(str==null||str.equals("")){
            return "";
        }
        char[] chas=str.toCharArray();
        String res=String.valueOf(chas[0]);
        int num=1;
        for (int i = 1; i <chas.length ; i++) {
            if(chas[i]!=chas[i-1]){
                res=concat(res,String.valueOf(num),String.valueOf(chas[i]));
                num=1;
            }else {
                num++;
            }
        }
        return concat(res,String.valueOf(num),"");

    }



    public static String concat(String s1, String s2, String s3) {
        return s1 + "_" + s2 + (s3.equals("") ? s3 : "_" + s3);
    }


    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        String str=in.nextLine();
        String res=getCountString(str);
        System.out.println(res);
    }
}