Commercial project#8708

Commercial project

1 second
64 megabytes
Easy

The company "UltraSoft" has employees. Each employee reports to exactly one department manager. Several departments have their own managers, who also report to higher-level managers, all the way up to the CEO.

During a company forum, employees from various departments devised a way to optimize a project the company is working on. To implement this optimization, each involved employee must obtain approval from their department manager, and each department manager must, in turn, seek approval from their own manager. The project will be approved if the chain of approvals converges at a common manager for all the employees who proposed the optimization.

How many employees and managers need to be involved to secure approval for the innovation?

Input

The first line contains the integer — the total number of employees at "UltraSoft" (1 \le N \le 10^5). The company's employee hierarchy is described in the following line.The second line contains N-1 integers, representing the manager numbers for each employee from to . The CEO is designated as number .The third line contains the integer — the number of employees who proposed the innovation. The fourth line lists the numbers of these employees.

Output

Output a single integer — the total number of company employees who need to be involved in the project approval process.

Examples

Example 1

Loading
Loading