OpenKattis

# Free food

Hsara loves free food.

Tonight Hsara is going out for a dinner at a restaurant with his organisation and Hsara is thinking about the chances of someone else paying for the dinner. Exactly one person will pay for the entire dinner (everyone’s food), but not any person. It is only allowed to pay for dinner if no supperior (possibly indirect, for example, your boss’ boss) in the organisation is present at the table.

The organisation consists of $N$ people numbered from $1$ to $N$. Each person, except for the CEO, has exactly one boss. Given each person’s boss and a list of people present at the table, determine how many people are able to pay for the dinner.

## Input

The first line consists of two integers, $N$ - the number of people in the organisation and $1 \le M \le N$ - the number of people at the table.

The second line consists of $N$ integers. The $i$:th integer is the boss of person $i$. 0 means that person $i$ is the CEO. There will be exactly one CEO.

The third line consists of $M$ integers indicating the people present at the table.

## Output

Print an integer - the number of people at the table who would be able to pay for the dinner.

Your solution will be tested on several groups of test cases. To get points for a group you need to pass all the tests of that group.

 Group Points Constraints 1 49 $2 \le N \le 2\, 000$ 2 51 $2 \le N \le 100\, 000$.

## Explanation

In the first sample person 1 and person 2 can pay. Person 3 can’t pay because person 1 is at the table.

In the second sample person 5 is the CEO and at the table. Therefore only person 5 can pay.

Sample Input 1 Sample Output 1
5 3
5 5 4 1 0
1 2 3

2

Sample Input 2 Sample Output 2
6 5
5 4 4 5 0 1
5 1 3 2 4

1