Buggy python submission (verdict: Time Limit Exceeded):
#二分探索
from bisect import bisect_left
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()
Bis_B = []
for i in range(N):
    Bis_B.append(bisect_left(A,B[i]))

#print(Bis_B)

ans = 0
for i in range(N):
    M = bisect_left(B, C[i])
    if M == 0: #この文で余分な動作を少し減らせる
        continue
    ans += sum(Bis_B[:M]) #この探索を複数回やってしまっている？
print(ans)


Fixed submission:
from bisect import bisect_left
from bisect import bisect_right
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()
ans = 0
for i in range(N):
    ab = bisect_left(A,B[i])
    bc = N-bisect_right(C,B[i])
    #print(ab, end='  ')
    #print(bc)
    ans += ab*bc
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#二分探索
from bisect import bisect_left
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()

#3重を考えるとC<B<A
ans = 0
for i in range(N):
    M = bisect_left(B, C[i])
    if M == 0:
        continue
    for j in range(M):
        ans += bisect_left(A,B[j])
print(ans)

Fixed submission:
from bisect import bisect_left
from bisect import bisect_right
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()
ans = 0
for i in range(N):
    ab = bisect_left(A,B[i])
    bc = N-bisect_right(C,B[i])
    #print(ab, end='  ')
    #print(bc)
    ans += ab*bc
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#二分探索
from bisect import bisect_left
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()

#3重を考えるとC<B<A
ans = 0
for i in range(N):
    M = bisect_left(B, C[i])
    if M == 0:
        continue
    for j in range(M):
        ans += bisect_left(A,B[j])
print(ans)

Fixed submission:
from bisect import bisect_left
from bisect import bisect_right
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()
ans = 0
for i in range(N):
    ab = bisect_left(A,B[i])
    bc = N-bisect_right(C,B[i])
    #print(ab, end='  ')
    #print(bc)
    ans += ab*bc
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#二分探索
from bisect import bisect_left
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()

#3重を考えるとC<B<A
ans = 0
for i in range(N):
    M = bisect_left(B, C[i])

    #ans += M
    for j in range(M):
        ans += bisect_left(A,B[j])


print(ans)

Fixed submission:
from bisect import bisect_left
from bisect import bisect_right
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()
ans = 0
for i in range(N):
    ab = bisect_left(A,B[i])
    bc = N-bisect_right(C,B[i])
    #print(ab, end='  ')
    #print(bc)
    ans += ab*bc
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
#二分探索
from bisect import bisect_left
#input
N = int(input())
#print(N)

A = list(map(int, input().split())) #この表記について...
B = list(map(int, input().split()))
C = list(map(int, input().split()))
#print(A,B,C)

#sort 昇順に並び替え
A.sort()
B.sort()
C.sort()

#3重を考えるとC<B<A
ans = 0
for i in range(N):
    M = bisect_left(B, C[i]) 
    #ans += M
    for j in range(M):
        ans += bisect_left(A,B[j])


print(ans)

Fixed submission:
from bisect import bisect_left
from bisect import bisect_right
#input
N = int(input())
#print(N)

A = sorted(list(map(int, input().split()))) #この表記について...
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
#print(A,B,C)

#sort 昇順に並び替え
#A.sort()
#B.sort()
#C.sort()
ans = 0
for i in range(N):
    ab = bisect_left(A,B[i])
    bc = N-bisect_right(C,B[i])
    #print(ab, end='  ')
    #print(bc)
    ans += ab*bc
print(ans)