Jewels and Stones

http://www.codechef.com/viewsolution/6419925

CAN ANY ONE GIVE A TEST CASE WHERE ABOVE SOLUTION FAILS, I AM NOT ALE TO FIGURE OUT help.
for the problem,----
http://www.codechef.com/problems/STONES/

Try this
1
aaa
a
Answer should be 1.

thnx a lot!!!