http://www.codechef.com/DEC13/problems/ALEXNUMB