DAYOUT2D - Dragons

no tags 

Our country is being attacked by the Enemy country. The soldiers are coming in a line. There are different kinds of soldiers. Our spy informed us that they have Dragons. He also drew a sketch how they look. Now you have to find how many Dragons they have so that we can prepare ourselves.

আমাদের দেশকে শত্রু দেশ আক্রমন করতে আসতেছে। শত্রুসেনারা এক লাইন ধরে আসতেছে।তাদের মধ্যে বিভিন্ন ধরনের সেনা আছে। আমাদের স্পাই খবর দিছে যে তাদের সাথে ড্রাগন আছে। সে ড্রাগনের একটা ছবিও একে পাঠাইছে। এখন তোমাকে তাদের মধ্যে কতগুলা ড্রাগন আছে এইটা বের করতে হবে।

Input

The first line of input file contains the number of test cases T (T ≤ 25). Each test case is composed of two lines, where the first line describes the line of soldiers using a string (a sequence of nonempty alphabetical characters). A single character means a single soldier or a Dragon. There will be no space between two consecutive soldiers (characters). The second line contains a single character describing the Dragon. Now you have to find the number of Dragons in the line of soldiers, that is, number of occurrences of the given character in the previous string. The maximum number of soldiers will not be greater than 100. The problem is case sensitive, that means d and D are two different types of soldiers.

ইনপুট ফাইলের প্রথম লাইনে থাকবে কতগুলা টেস্ট কেস আছে, একটা নাম্বার T(T≤25) দিয়ে। প্রত্যেকটা টেস্ট কেস এ 2 টা লাইন থাকবে। প্রথম লাইনে থাকবে সেনাদের বর্ননা, একটা স্ট্রিং(একটা ননএম্পটি আলফাবেটিকাল ক্যরেক্টারের সিকুয়েন্স)। দ্বিতীয় লাইনে থাকবে একটা ক্যরেক্টার যেটা একটা ড্রাগন কে বর্ননা করবে। এখন তোমাকে সেনাদের লাইনে কতগুলা ড্রাগন আছে এইটা বের করতে হবে, তার মানে আগের স্ট্রিং-এ ক্যরেক্টারটা কতবার আছে এইটা বের করতে হবে। সেনার সংখা 100 এর বেশি হবে না। প্রব্লেমটা কেস সেন্সেটিভ, তার মানে ‘d’ এবং ‘D’ দুইটা আলাদা ধরনের সেনা।

Output

For each case, print a line like “Case X: N”, without the quotes, where X is the number of test case starting from 1 and N is the number of Dragons. Check sample input and output sections for more details.

প্রত্যেকটা কেস এর জন্য একটা লাইন “Case X: N” প্রিন্ট করতে হবে, কোট ছাড়া, যেখানে X হল 1 থেকে শুরু হওয়া টেস্ট কেস এর নাম্বার, আর N হল ড্রাগন এর সংখা। বিস্তারিত এর জন্য স্যাম্পল ইনপুট এবং আওটপুট দেখ।

Example

Input:
5
ssddDddssdSdsdsd
D
adnalkdjfkasdjkaa
d
aaknklopmnhlakdjsfksdakldjfalkdfla
a
k
k
huioplnouol
a Output: Case 1: 1
Case 2: 3
Case 3: 6
Case 4: 1
Case 5: 0


Added by:Shafaet
Date:2013-01-17
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own problem