The country of KhoaNali is structured as a giant road with buildings on both sides, the northern buildings being houses and the southern buildings being workplaces. Each house has a unique label and each workplace has a unique label .
Person () lives in house and goes to work at workplace if .
Due to the recent NorocaVirus situation, everyone decided to distance himself from others. But due to the structure of KhoaNali, some of them may end up meeting someone else on their way. Your job is to find out the number of unordered pairs such that Person can meet Person on his way.
The first line contains an integer () — the number of buildings on each side of the road.
Second line contains integers () — labels of the houses.
Third line contains integers () — labels of the workplaces.
Print a single integer — the number of unordered pairs such that Person and Person can meet on their way.
Input | Output |
---|---|
4 1 2 3 4 2 4 1 3 | 3 |
In the sample the pairs that can meet are , , and . |