Bob is given three arrays A, B and C of length N each. A pair of indices (i,j), where 0≤i,j<N is called good if A[i] is equal to B[C[j]].
Find an integer X denoting the number of good indices.
Input format
Output format
For each test case, print an integer X denoting the number of good indices in a new line.
Constraints
1≤T≤101≤N≤1050≤A[i],B[i],C[i]<N
For test case 1:
Hence the answer is 3.
For test case 2: N is 1. So, only one good pair exists.