uCoder | 1206 | Nível: 3 | Tempo Limite: 3

Competition

Adaptado por Erich Rodrigues

Competição: SBC - ACM/ICPC - Maratona de Programação de 2015 - Final Nacional

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 ≤ 10^{9} ), A (1 ≤ A ≤ min(N, 5 ∗ 10^{4} )) and B (1 ≤ B ≤ min(N, 5 ∗ 10^{4} )). 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.

Exemplo de Entrada | Exemplo de Saída |
---|---|

4 3 3 |
0 |

4 3 3 |
1 |

5 2 3 |
4 |