#include <stdio.h>
float err=0, vars[27], q, r; char s1[1024]=" ", *st=s1+1, *x, *y, g, f=1;
float main(char *s, int i1, int i2, int u)
{ char c=0, op[]=",=+-*/", *p, *t, d; int br=0, i;
if (f) goto l1; else if (i1>i2) { err=err?1:!u; return 0; }
for (p=op; *p; p++)
for (i=(*p=='='?i1:i2); d=s[i],(*p=='='?i<=i2:i>=i1); (*p=='='?i++:i--))
if(!br&&d==*p){c=*p;goto l;} else if(d=='('||d==')')br+=(d=='('?1:-1);
l: if (c==',') { main(s, i1, i-1, 0); return main(s, i+1, i2, 0); }
if(d=s[i1]&223,c=='=') return i1==i-1&&d>64&&d<91?vars[d-65]=main(s,i+1,i2,0):(err=1,0);
if((s[i-1]&223)!='E'&&(c=='+'||c=='-'))return main(s,i1,i-1,1)+(44-c)*main(s,i+1,i2,0);
if (c=='/') {q=main(s, i+1, i2, 0); return q?main(s, i1, i-1, 0)/q:(err=1);}
if (c=='*') return main(s, i1, i-1, 0)*main(s, i+1, i2, 0);
if(s[i1]=='(') return s[i2]==')'?main(s, i1+1, i2-1, 0):(err=1,0);
if (i1==i2 && (s[i1]&223)>64 && (s[i1]&223)<91) return vars[(s[i1]&223)-65];
return (sscanf(s+i1,"%g%n",&r,&i) && i==i2-i1+1)?r:(err=1, 0);
l1:for(f=0,gets(st),x=st,y=st; err=0,g=x,(x>st?(x-1):*st); x++)
if(g!=' '||*(y-1)>47&&*(y-1)<58&&*(x+1)>47&&*(x+1)<58)*(y++)=(g?*x:0);
if (printf((err?"Error!\n\n":"%g\n\n"), main(st, 0, y-st-2, 0))) goto l1;
}