#golden week D=int(input()) C1=input() C2=input() C=C1+C2 i=0 Cn=[D] co=0 while i =0: if i%2==1: g+=Cn[i] # print (g) elif V>=Cn[i]: g+=Cn[i] V=0 elif V>0: if g==0: g+=V V=0 else: g+=V V=-1 else: V=-1 i+=1 # print (g) # print (g) if g>m: m=g j+=1 print(m)