Competition

1206
Tempo Limite: 3 | Nível: 3

Descrição

Bob and Alice are participating in a programming contest as a team.

The contest has N problems which must be solved in order. Naturally there are some problems that they cannot solve, in that case they can skip it. There may be also problems that only Bob or Alice
alone can solve.

They want to solve all the problems possible switching as few times as possible who is at the computer programming the solution.

Given the number of problems and the problems that Bob and Alice can solve, calculate the minimum number of switches between the usage of the computer. Anyone can start using it.


Entrada

The first line contains three integers N (1 ≤ N ≤ 109 ), A (1 ≤ A ≤ min(N, 5 ∗ 104 )) and B (1 ≤ B ≤ min(N, 5 ∗ 104 )). The next line contains A unique integers denoting the problems Alice can solve. The following line contains B unique integers denoting the problems Bob can solve. The first problem is denoted by the number 1, the second by number 2, the N -th by N , and so on.


Saída

Print the minimum number of switches between the usage of the computer.


Exemplos de Entrada Exemplos de Saída

4 3 3
1 3 4
4 3 1

0

4 3 3
1 2 3
2 3 4

1

5 2 3
2 4
1 5 3

4

Efetue Login ou Cadastre-se para submeter uma solução.



Criado por Bruno Junqueira Adami, Brazil | Adaptado por Erich Rodrigues | Competição: SBC - ACM/ICPC - Maratona de Programação de 2015 - Final Nacional