Nokia Interview Question

Given a string a = 'aabcccdeaaa' output '2b3de3'