import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
char[] chars = s.toCharArray();
ArrayList<Character> listStr = new ArrayList<>(); //存字母
ArrayList<Integer> listnum = new ArrayList<>(); //存字母个数
int num=-1;
int count=0;
for (int i = 0; i < chars.length-1; i++) { //这里的局限是最后面的字符截取不到,然后下面进行了补充list
if(chars[i+1]!=chars[i]){
listStr.add(chars[i]);
listnum.add(i-num);
num = i;
}
}
for (Integer n:listnum) {
count += n;
}
if (count<chars.length){ //通过listnum里面的总和和开始客户端输入的字符长度对比
listStr.add(chars[count]);
listnum.add(chars.length-count); //差值就是上面没有取到的最后一段字符的长度
}
for (int i=0;i<listStr.size();i++) {
System.out.print(listnum.get(i));
System.out.print(listStr.get(i));
}
}
}