t=int(input()) cm=[] sk=[] ttm=[-11111111111111111] cr=[-10000000000000000] for i in range(t): a=int(input()) if(a>=0 and a%2==0): cm.append(a) elif(a>=0 and a%2!=0): sk.append(a) elif(a<=0 and a%2==0):
ttm.append(a) elif(a<=0 and a%2!=0): cr.append(a)
if(len(cm)==0): cm.append(0) if(len(sk)==0): sk.append(0) print(max(sum(cm)-min(cm),sum(cm)+max(ttm))+max(sum(sk)-min(sk),sum(sk)+max(cr)))