Dessert Preparation#2502

Dessert Preparation

2 seconds
256 megabytes
Easy

Preparing desserts can be considered a craft, an art, or a science. In this problem, we will follow the scientific approach.

A coffee shop offers a wide selection of desserts, each consisting of a slice of pie with filling, topped with a scoop of ice cream. The pie crust can be made in different ways, there are filling options, and types of ice cream. However, not every crust goes well with every filling, not every filling with every ice cream, and not every ice cream with every crust.

Your task is to determine the number of types of desserts that can be made so that all three ingredients are compatible with each other.

Input

The first line contains three integers: , , and (1 \le n, m, k \le 50).

The second line contains one integer (0 \le p \le 200), the number of incompatible pairs of crust types and fillings. Each of the next lines contains two integers and (1 \le a \le n, 1 \le b \le m): the numbers of a crust type and a filling that are incompatible. No pair of incompatible crust and filling appears more than once.

The next line contains one integer (0 \le q \le 200), the number of incompatible pairs of fillings and ice cream types. Each of the next lines contains two integers and (1 \le a \le m, 1 \le b \le k): the numbers of a filling and an ice cream type that are incompatible. No pair of incompatible filling and ice cream type appears more than once.

The next line contains one integer (0 \le r \le 200), the number of incompatible pairs of crust types and ice cream types. Each of the next lines contains two integers and (1 \le a \le n, 1 \le b \le k): the numbers of a crust type and an ice cream type that are incompatible. No pair of incompatible crust and ice cream type appears more than once.

Output

Print a single integer — the number of types of desserts that can be made so that all three ingredients are compatible with each other.

Examples

Example 1

Loading
Loading