Problem F: Search - Binary Search

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $49$ 正确数量 $22$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 二分 STL

Search II 

You are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.

In the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.
Print C in a line.
5
1 2 3 4 5
3
3 4 1
3

Elements in S is sorted in ascending order 

n ≤  100000 q ≤  50000 

0 ≤  an element in S ≤  10^9 

0 ≤  an element in T ≤  10^9