jewels and stones

my code is giving me the desired output on my compiler but code chef is giving wrong answer for that…
please check what’s wrong with my code…here it is…http://www.codechef.com/viewsolution/4330856

Please include the link to the question along with an explanation of your logic while posting questions here .

//