a,p;main(s){for(scanf("%d",&s);p=getchar()-10;(p%2)&&(s*=a)||(s+=a))scanf("%d",&a);a=!printf("%d",s);}