counting pretty numbers codechef solution