#P1257E. The Contest

    ID: 3969 Type: RemoteJudge 2000ms 512MiB Tried: 0 Accepted: 0 Difficulty: 7 Uploaded By: Tags>data structuresdpgreedy*2000

The Contest

Description

A team of three programmers is going to play a contest. The contest consists of nn problems, numbered from 11 to nn. Each problem is printed on a separate sheet of paper. The participants have decided to divide the problem statements into three parts: the first programmer took some prefix of the statements (some number of first paper sheets), the third contestant took some suffix of the statements (some number of last paper sheets), and the second contestant took all remaining problems. But something went wrong — the statements were printed in the wrong order, so the contestants have received the problems in some random order.

The first contestant has received problems a1,1,a1,2,,a1,k1a_{1, 1}, a_{1, 2}, \dots, a_{1, k_1}. The second one has received problems a2,1,a2,2,,a2,k2a_{2, 1}, a_{2, 2}, \dots, a_{2, k_2}. The third one has received all remaining problems (a3,1,a3,2,,a3,k3a_{3, 1}, a_{3, 2}, \dots, a_{3, k_3}).

The contestants don't want to play the contest before they redistribute the statements. They want to redistribute them so that the first contestant receives some prefix of the problemset, the third contestant receives some suffix of the problemset, and the second contestant receives all the remaining problems.

During one move, some contestant may give one of their problems to other contestant. What is the minimum number of moves required to redistribute the problems?

It is possible that after redistribution some participant (or even two of them) will not have any problems.

The first line contains three integers k1,k2k_1, k_2 and k3k_3 (1k1,k2,k32105,k1+k2+k321051 \le k_1, k_2, k_3 \le 2 \cdot 10^5, k_1 + k_2 + k_3 \le 2 \cdot 10^5) — the number of problems initially taken by the first, the second and the third participant, respectively.

The second line contains k1k_1 integers a1,1,a1,2,,a1,k1a_{1, 1}, a_{1, 2}, \dots, a_{1, k_1} — the problems initially taken by the first participant.

The third line contains k2k_2 integers a2,1,a2,2,,a2,k2a_{2, 1}, a_{2, 2}, \dots, a_{2, k_2} — the problems initially taken by the second participant.

The fourth line contains k3k_3 integers a3,1,a3,2,,a3,k3a_{3, 1}, a_{3, 2}, \dots, a_{3, k_3} — the problems initially taken by the third participant.

It is guaranteed that no problem has been taken by two (or three) participants, and each integer ai,ja_{i, j} meets the condition 1ai,jn1 \le a_{i, j} \le n, where n=k1+k2+k3n = k_1 + k_2 + k_3.

Print one integer — the minimum number of moves required to redistribute the problems so that the first participant gets the prefix of the problemset, the third participant gets the suffix of the problemset, and the second participant gets all of the remaining problems.

Input

The first line contains three integers k1,k2k_1, k_2 and k3k_3 (1k1,k2,k32105,k1+k2+k321051 \le k_1, k_2, k_3 \le 2 \cdot 10^5, k_1 + k_2 + k_3 \le 2 \cdot 10^5) — the number of problems initially taken by the first, the second and the third participant, respectively.

The second line contains k1k_1 integers a1,1,a1,2,,a1,k1a_{1, 1}, a_{1, 2}, \dots, a_{1, k_1} — the problems initially taken by the first participant.

The third line contains k2k_2 integers a2,1,a2,2,,a2,k2a_{2, 1}, a_{2, 2}, \dots, a_{2, k_2} — the problems initially taken by the second participant.

The fourth line contains k3k_3 integers a3,1,a3,2,,a3,k3a_{3, 1}, a_{3, 2}, \dots, a_{3, k_3} — the problems initially taken by the third participant.

It is guaranteed that no problem has been taken by two (or three) participants, and each integer ai,ja_{i, j} meets the condition 1ai,jn1 \le a_{i, j} \le n, where n=k1+k2+k3n = k_1 + k_2 + k_3.

Output

Print one integer — the minimum number of moves required to redistribute the problems so that the first participant gets the prefix of the problemset, the third participant gets the suffix of the problemset, and the second participant gets all of the remaining problems.

Sample Input 1

2 1 2
3 1
4
2 5

Sample Output 1

1

Sample Input 2

3 2 1
3 2 1
5 4
6

Sample Output 2

0

Sample Input 3

2 1 3
5 6
4
1 2 3

Sample Output 3

3

Sample Input 4

1 5 1
6
5 1 2 4 7
3

Sample Output 4

2

Note

In the first example the third contestant should give the problem 22 to the first contestant, so the first contestant has 33 first problems, the third contestant has 11 last problem, and the second contestant has 11 remaining problem.

In the second example the distribution of problems is already valid: the first contestant has 33 first problems, the third contestant has 11 last problem, and the second contestant has 22 remaining problems.

The best course of action in the third example is to give all problems to the third contestant.

The best course of action in the fourth example is to give all problems to the second contestant.