Capgemini Interview Question

Write a program to get the following output - Input - "aabbbcccc" Output - "a2b3c4"