N=int(input()) T=list(map(int,input().split())) S=list(map(int,input().split())) ans=0 i=0 end=-0.1 for s in S: if end