# max(g,b) <= r < g+b from bisect import bisect_left as bl , bisect_right as br from collections import Counter n = int(input()) r = list(map(int,input().split())) g = list(map(int,input().split())) b = list(map(int,input().split())) rs=sorted(tuple(Counter(r).items())) gs=sorted(tuple(Counter(g).items())) bs=sorted(tuple(Counter(b).items())) rcnt = [0] for i in range(len(rs)): rcnt.append(rcnt[-1]+rs[i][1]) rk = [0]+[i for i,j in rs] assert 1 != 1,len(bs) assert 1 != 1,len(gs)