Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = sorted(list(map(int, input().split(" "))))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in b:
  #print((a[:bisect.bisect(a, i - 1)]), i, c[bisect.bisect_left(c, i + 1):]) 
  count += len(a[:bisect.bisect(a, i - 1):]) * len(a[bisect.bisect_right(c, i):]) 
print(count)

Fixed submission:
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = list(map(int, input().split(" ")))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in b:
  #print((a[:bisect.bisect_right(a, i - 1)]), i, c[bisect.bisect_left(c, i + 1):]) 
  #print(bisect.bisect_right(a, i - 1), i, (n - bisect.bisect_left(c, i + 1)) ) 
  count += bisect.bisect_right(a, i - 1) * (n - bisect.bisect_left(c, i + 1)) 
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = sorted(list(map(int, input().split(" "))))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in b:
  #print((a[:bisect.bisect(a, i - 1)]), i, c[bisect.bisect_left(c, i + 1):]) 
  count += len(a[:bisect.bisect(a, i - 1):]) * len(a[bisect.bisect_right(c, i):]) 
print(count)

Fixed submission:
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = list(map(int, input().split(" ")))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in b:
  #print((a[:bisect.bisect_right(a, i - 1)]), i, c[bisect.bisect_left(c, i + 1):]) 
  #print(bisect.bisect_right(a, i - 1), i, (n - bisect.bisect_left(c, i + 1)) ) 
  count += bisect.bisect_right(a, i - 1) * (n - bisect.bisect_left(c, i + 1)) 
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = sorted(list(map(int, input().split(" "))))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in a:
  for j in b[bisect.bisect_left(b, i + 1):]:
    #for k in c[bisect.bisect_left(c, j):]:
    #print(i, j, c[bisect.bisect_left(c, j + 1):])
    count += len(c[bisect.bisect_left(c, j + 1):])
print(count)

Fixed submission:
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = list(map(int, input().split(" ")))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in b:
  #print((a[:bisect.bisect_right(a, i - 1)]), i, c[bisect.bisect_left(c, i + 1):]) 
  #print(bisect.bisect_right(a, i - 1), i, (n - bisect.bisect_left(c, i + 1)) ) 
  count += bisect.bisect_right(a, i - 1) * (n - bisect.bisect_left(c, i + 1)) 
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = sorted(list(map(int, input().split(" "))))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in a:
  for j in b[bisect.bisect_left(b, i + 1):]:
    #for k in c[bisect.bisect_left(c, j):]:
    #print(i, j, c[bisect.bisect_left(c, j + 1):])
    count += len(c[bisect.bisect_left(c, j + 1):])
print(count)

Fixed submission:
import bisect

n = (int)(input())
a = sorted(list(map(int, input().split(" "))))
b = list(map(int, input().split(" ")))
c = sorted(list(map(int, input().split(" "))))

count = 0
for i in b:
  #print((a[:bisect.bisect_right(a, i - 1)]), i, c[bisect.bisect_left(c, i + 1):]) 
  #print(bisect.bisect_right(a, i - 1), i, (n - bisect.bisect_left(c, i + 1)) ) 
  count += bisect.bisect_right(a, i - 1) * (n - bisect.bisect_left(c, i + 1)) 
print(count)