Soma is a fashionable girl. She absolutely loves shiny stones that she can put on as jewellery accessories. She has been collecting stones since her childhood - now she has become really good with identifying which ones are fake and which ones are not.  Her King requested for her help in mining precious stones, so she has told him which all stones are jewels and which are not. Given her description, your task is  to count the number of jewel stones. 

More formally, you're given a string J composed of latin characters where each character is a jewel. You're also given a string S composed of latin characters where each character is a mined stone. You have to find out how many characters of S are in J as well. 

-----Input-----

First line contains an integer T denoting the number of test cases. Then follow T test cases. Each test case consists of two lines, each of which contains a string composed of English lower case and upper characters. First of these is the jewel string J and the second one is stone string S. 
You can assume that  1 <= T <= 100, 1 <= |J|, |S| <= 100


-----Output-----
Output for each test case, a single integer, the number of jewels mined. 

-----Example-----
Input:
4
abc
abcdef
aA
abAZ
aaa
a
what
none

Output:
3
2
1
0

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = '# Jewels.py\n# Code Chef Problem: Jewels and Stones\n#   http://www.codechef.com/MAY12/problems/STONES\n#   May Long Challenge 2012\n# Benjamin Johnson\n# May 4 2012 \n# Lessons Learned:\n\nimport sys,time,math\n\n#Use the test file when testing\n#testInputFile = open("test.in","r")\n\n#Get input here\ntestCases = int(sys.stdin.readline())\n#testCases = int(testInputFile.readline())\n\nfor i in range(testCases):\n count = 0\n jewels = {}\n #jewelsLine = testInputFile.readline().strip()\n jewelsLine = sys.stdin.readline().strip()\n for char in jewelsLine:\n  if char in jewels:\n   jewels[char] += 1\n  else:\n   jewels[char] = 1\n #stonesLine = testInputFile.readline().strip()\n stonesLine = sys.stdin.readline().strip()\n for stone in stonesLine:\n  if stone in jewels:\n   if jewels[stone] > 0:\n    #jewels[stone] -= 1\n    count += 1\n sys.stdout.write("%d\\n"%count)\n\n#testInputFile.close()\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13267