N ladies attend the ball in the King's palace. Every lady can be described with three values: beauty, intellect and richness. King's Master of Ceremonies knows that ladies are very special creatures. If some lady understands that there is other lady at the ball which is more beautiful, smarter and more rich, she can jump out of the window. He knows values of all ladies and wants to find out how many probable self-murderers will be on the ball. Lets denote beauty of the i -th lady by B i , her intellect by I i and her richness by R i . Then i -th lady is a probable self-murderer if there is some j -th lady that B i B j , I i I j , R i R j . Find the number of probable self-murderers.
输入描述:
The first line contains one integer N (1 ≤ N ≤ 500000). The second line contains N integer numbers Bi, separated by single spaces. The third and the fourth lines contain sequences Ii and Ri in the same format. It is guaranteed that 0 ≤ Bi, Ii, Ri ≤ 109.


输出描述:
Output the answer to the problem.
示例1

输入

3<br />1 4 2<br />4 3 2<br />2 5 3<br />

输出

1<br />
加载中...