Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
Clist.reverse()
retnum = 0 
for i in Blist:
    Anum = 0 
    Cnum = 0 
    for i2 in Alist:
        if i2 >= i:
            break
        Anum +=1 
    for i2 in Clist:
        if i2 <= i:
            break
        Cnum +=1 
    retnum +=(Anum * Cnum)
print(retnum)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import bisect
a=int(raw_input())
Ali = np.array( map(int,raw_input().split()))
Bli =np.array(map(int,raw_input().split()))
Cli =np.array(map(int,raw_input().split()))
Ali = np.sort(Ali)
Cli = np.sort(Cli)[::-1]
co=0
for B in Bli:
    ca = bisect.bisect_left(Ali,B)
    cb =0
    for C in Cli:
        if C <= B:
            break
        else:
            cb +=1 
    co += ca*cb
print(co)
~           

Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
raw_input()
Ali = np.array( map(int,raw_input().split()))
Bli =np.array(map(int,raw_input().split()))
Cli =np.array(map(int,raw_input().split()))
Ali = np.sort(Ali)
Cli = np.sort(Cli)[::-1]
co=0
for B in Bli:
    ca = 0 
    for A in Ali:
        if A >= B:
            break
        else:
            ca+=1
    cb =0
    for C in Cli:
        if C <= B:
            break
        else:
            cb +=1 
    co += ca*cb
print(co)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a = int(raw_input())
Ali = (np.array( map(int,raw_input().split())))
Bli =(np.array(map(int,raw_input().split())))
Cli =(np.array(map(int,raw_input().split())))
Ali = np.sort(Ali)
Bli = np.sort(Bli)
Cli = np.sort(Cli)[::-1]
co=0
for B in Bli:
    ca = 0 
    for A in Ali:
        if A >= B:
            break
        else:
            ca+=1
    cb =0
    for C in Cli:
        if C <= B:
            break
        else:
            cb +=1 
    co += ca*cb
print(co)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a = int(raw_input())
Ali = (np.array( map(int,raw_input().split())))
Bli =(np.array(map(int,raw_input().split())))
Cli =(np.array(map(int,raw_input().split())))
Ali = np.sort(Ali)
Bli = np.sort(Bli)
Cli = np.sort(Cli)[::-1]
co=0
for B in Bli:
    ca = 0 
    for A in Ali:
        if A >= B:
            break
        else:
            ca+=1
    cb =0
    for C in Cli:
        if C <= B:
            break
        else:
            cb +=1 
    co += ca*cb
print(co)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a = int(raw_input())
Ali = (np.array( map(int,raw_input().split())))
Bli =(np.array(map(int,raw_input().split())))
Cli =(np.array(map(int,raw_input().split())))
Ali = np.sort(Ali)
Bli = np.sort(Bli)[::-1]
Cli = np.sort(Cli)[::-1]
co=0
for A in Ali:
    if A >= Bli[0]:
        break
    for B in Bli:
        if A >= B:
            break
        for C in Cli:
            if B >= C:
                break
            co +=1 
print(co)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a = int(raw_input())
Ali = (np.array( map(int,raw_input().split())))
Bli =(np.array(map(int,raw_input().split())))
Cli =(np.array(map(int,raw_input().split())))
Bli = np.sort(Bli)[::-1]
Cli = np.sort(Cli)[::-1]
co=0
for A in Ali:
    for B in Bli:
        if A >= B:
            break
        for C in Cli:
            if B >= C:
                break
            co +=1 
print(co)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a = int(raw_input())
Ali = np.array( map(int,raw_input().split()))
Bli = np.array(map(int,raw_input().split()))
Cli = np.array(map(int,raw_input().split()))
co=0
for A in Ali:
    for B in Bli:
        if A < B:
            for C in Cli:
                if B < C:
                    co +=1 
print(co)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a = int(raw_input())
Ali = np.array( map(int,raw_input().split()))
Bli = np.array(map(int,raw_input().split()))
Cli = np.array(map(int,raw_input().split()))
co=0
for i1 in range(a):
    for i2 in range(a):
        if Ali[i1] < Bli[i2]:
            for i3 in range(a):
                if Bli[i2] < Cli[i3]:
                    co +=1 
print(co)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
Ali = map(int,raw_input().split())
Bli = map(int,raw_input().split())
Cli = map(int,raw_input().split())
co=0
for A in Ali:
    for B in Bli:
        if A < B:
            for C in Cli:
                if B < C:
                    co +=1 
print(co)


Fixed submission:
import bisect
N = int(input())
Alist = list(map(int,input().split()))
Blist = list(map(int,input().split()))
Clist = list(map(int,input().split()))
Alist.sort()
Clist.sort()
retnum = 0 
for i in Blist:
    Anum = bisect.bisect_left(Alist,i)
    Cnum =  N - bisect.bisect_right(Clist,i)
    retnum +=(Anum * Cnum)
print(retnum)