n = int(input()) r = list(map(int,input().split())) g = list(map(int,input().split())) b = list(map(int,input().split())) c = 0 for i in r: for j in g: for k in b: if i >= j and i >= k and i < j + k: c += 1 print(c)