P10651 [HackerEarth] 1 7
普及
题目描述

Raj and simran are in love. but thakur baldev singh doesnt want them to be together. But baldev Singh cares for her daughter too. He wants raj to prove his love for her daughter and family. So Baldev singh being a great lover of strings sets up problem for raj. he screams out a string and asks simran to choose her favourite alphabet. inorder to win simran, raj would have to speak out the no. of times that character appears in the screamed string.

Input

first line contains T . no of test cases

next T lines contains string s and character c .

Output

count of character c in string s .

Constraint

0 < T < 100

0 < sizeof(string s) ≤ 1000

c = {a-z}

SAMPLE INPUT
2
abca a
bbb c

SAMPLE OUTPUT
2
0

输入格式

见题面

输出格式

见题面

样例输入
2 abca a bbb c SAMPLE
样例输出
2 0