input();s=0 for i,x in enumerate(list(map(int,input().split()))): if x<0:x*=-1 if x<2 or s==0:s+=x else: s*=x print(s)