第二题, 子序列之和的最大值
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a = sorted(a)
b = sorted(b)
res = len(b)
for x in a:
if x <= b[0]:
res += 1
a_idx = 0
b_idx = 0
while a_idx < len(a) and b_idx < len(b)-1:
while a_idx < len(a) and a[a_idx] <= b[b_idx+1]:
a_idx += 1
b_temp = b[b_idx+1:]
res = max(res, len(b_temp) + a_idx)
b_idx += 1
print(res)