import java.util.*;
class stringcompression{
public static void main(String [] args) {
Scanner sc = new Scanner (System.in);
String s;
s=sc.nextLine();
char [] c = s.toCharArray();
for(int i=0;i<c.length;i++) {
int counter =0;
for(int j=0;j<s.length();j++) {
if(j<i && c[j]==c[i]) {
break;
}
if(c[i]==c[j]) {
counter++;
}
if(j==c.length-1) {
if(counter>1) {
System.out.print(c[i]+""+counter);
}
else {
System.out.print(c[i]);
}
}
}//end of i loop
}
}
}