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: if i >= j: for k in b: if i >= k and i < j + k: c += 1 print(c)