K. CP and GIT
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Once upon a time, in the world of algorithms and data structures, there lived a competitive programmer named Yaman. Armed with his trusty keyboard and an unwavering passion for programming, he decided to build a git repository containing a project that would serve as a reference for his code in the field of competitive programming.

The project he is working on contains $$$n$$$ files numbered from $$$1$$$ to $$$n$$$, and the name of the $$$i$$$-th file is $$$s_i$$$.

The repository contains a section called Stage that currently contains $$$m$$$ files from the project's files, and the rest of the files are located outside the Stage in a section called Workspace. The $$$m$$$ files that are currently in the Stage are numbered from $$$1$$$ to $$$m$$$ and have names $$$a_1$$$, $$$a_2$$$, ..., $$$a_m$$$.

After thinking, Yaman wants to keep only $$$k$$$ files within the Stage and the rest within Workspace. The $$$k$$$ files that he wants to keep in the Stage are numbered from $$$1$$$ to $$$k$$$ and have names $$$b_1$$$, $$$b_2$$$, ..., $$$b_k$$$.

Yaman can perform the following operations any number of times (possibly zero):

  • Move a single file from Workspace into the Stage.
  • Move all files from Workspace into the Stage.
  • Move a single file from Stage into the Workspace.
  • Move all files from the Stage into the Workspace.

Help Yaman to determine the minimum number of operations he has to make to place just the $$$k$$$ files $$$b_1$$$, $$$b_2$$$, ..., $$$b_k$$$ in the Stage.

Input

The first line contains the number of test cases $$$t$$$ $$$( 1 \le t \le 100 )$$$. A description of the test cases follows.

The first line of each test case contains three integers $$$n, m, k$$$ $$$( 1 \le n \le 100 )$$$ $$$( 0 \le m, k \le n )$$$ — the number of files in the project, the number of files that are currently in the Stage, the number of files that have to be in the Stage at the end, respectively.

The second line contains $$$n$$$ strings $$$s_1, s_2, .., s_n$$$ $$$( 1 \le |s_i| \le 100 )$$$ — the names of the files (consists of lowercase Latin letters).

The third line contains $$$m$$$ strings $$$a_1, a_2, .., a_m$$$ $$$( 1 \le |a_i| \le 100 )$$$ — the files that are currently in the Stage.

The fourth line contains $$$k$$$ strings $$$b_1, b_2, .., b_k$$$ $$$( 1 \le |b_i| \le 100 )$$$ — the files that have to be in the Stage at the end.

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$100$$$.

It is guaranteed that the file names are unique.

Output

Print the minimum number of operations Yaman has to make to place just the $$$k$$$ files $$$b_1$$$, $$$b_2$$$, ..., $$$b_k$$$ in the Stage.

Example
Input
2
3 1 2
implementation greedy dp
dp
greedy implementation
4 3 2
geo trees math bs
geo trees math
math bs
Output
2
3