Count the triplets#9022

Count the triplets

2 seconds
128 megabytes
Very easy

Given three arrays and , each consisting of integers. Find the number of triplets (a_i, b_j, c_k) such that the inequality a_i < b_j < c_k holds.

Input

The first line contains the size of the arrays n~(n \le 10^5).

The second line contains the elements of array .

The third line contains the elements of array .

The fourth line contains the elements of array .

Output

Print the number of triplets (a_i, b_j, c_k) that satisfy the condition a_i < b_j < c_k.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

In the first test case, the valid triplets are (a_1, b_1, c_1), (a_1, b_2, c_1) and (a_1, b_2, c_2).