*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*<sub class="lower-index">*i*</sub>, her intellect by *I*<sub class="lower-index">*i*</sub> and her richness by *R*<sub class="lower-index">*i*</sub>. Then *i*-th lady is a probable self-murderer if there is some *j*-th lady that *B*<sub class="lower-index">*i*</sub> &lt; *B*<sub class="lower-index">*j*</sub>, *I*<sub class="lower-index">*i*</sub> &lt; *I*<sub class="lower-index">*j*</sub>, *R*<sub class="lower-index">*i*</sub> &lt; *R*<sub class="lower-index">*j*</sub>. Find the number of probable self-murderers.
The first line contains one integer *N* (1 ≤ *N* ≤ 500000). The second line contains *N* integer numbers *B*<sub class="lower-index">*i*</sub>, separated by single spaces. The third and the fourth lines contain sequences *I*<sub class="lower-index">*i*</sub> and *R*<sub class="lower-index">*i*</sub> in the same format. It is guaranteed that 0 ≤ *B*<sub class="lower-index">*i*</sub>, *I*<sub class="lower-index">*i*</sub>, *R*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>.
3
1 4 2
4 3 2
2 5 3
1
5
2 8 10 0 7
7 7 3 0 10
2 8 3 2 2
1
5
3 0 0 2 0
7 10 7 4 0
9 1 6 1 9
1
5
5 4 0 2 5
8 3 1 0 10
4 5 0 0 5
2
5
9 7 0 2 10
8 6 5 5 9
1 9 3 0 1
2
10
7 7 10 1 2 1 7 1 5 9
9 10 6 2 5 6 7 7 5 5
2 7 4 0 7 10 5 6 2 2
4
10
7 7 0 1 2 6 0 10 3 5
5 8 4 0 3 4 7 10 5 0
0 10 3 1 5 8 6 10 10 6
7
10
18 4 6 16 16 6 4 13 16 4
10 4 18 13 5 13 8 13 7 0
15 11 0 4 7 17 3 9 10 4
5
10
12 16 11 13 6 18 6 14 4 2
11 6 4 13 10 1 6 3 8 19
1 3 1 9 4 17 18 1 14 13
4
10
10 19 4 1 11 6 1 20 11 13
2 7 17 8 10 3 20 16 10 8
15 9 9 2 20 9 0 15 0 4
6
10
458 661 509 753 634 129 533 730 153 92
86 5 877 484 356 41 694 941 198 327
112 217 654 737 166 298 500 439 329 778
5
10
443 356 907 383 590 544 775 382 77 323
657 44 756 189 294 932 441 293 373 90
889 358 653 867 148 33 2 152 598 634
7
n=int(input())
res=0
b=list(map(int,input().split()))
i=list(map(int,input().split()))
r=list(map(int,input().split()))
bset,iset,rset=list(set(b)),list(set(i)),list(set(r))
bset.sort()
iset.sort()
rset.sort()
lb,li,lr=len(bset),len(iset),len(rset)
#print(b,i,r)
#print(bset,iset,rset)
for j in range(n):
    if (bset.index(b[j])!=lb-1) and (iset.index(i[j])!=li-1) and (rset.index(r[j])!=lr-1):
        res+=1
print(res)
