import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
System.out.println(compression(str));
}
public static String compression(String str) {
StringBuilder sb = new StringBuilder();
char last = str.charAt(0);
int count = 0;
for (int i=0; i< str.length(); i++) {
if (str.charAt(i) == last) {
count++;
} else {
sb.append(last + ββ + count);
count = 1; // here count should be 1 but not 0
}
last = str.charAt(i);
}
sb.append(last + ββ + count); //reflush the last part
String newStr = sb.toString();
if (newStr.length() < str.length()) {
return newStr;
} else {
return str;
}
}
}