include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
int main()
{
long long int ans,tmpx,tmp;
ans=0;
tmpx=1;
tmp=0;
char buf;
while(scanf(“%c”,&buf)==1&&buf!=10)
{
if(buf-‘0’<=9&&buf-‘0’>=0)
{
tmp*=10;
tmp+=buf-‘0’;
}
if(buf=='+')
{
if(tmpx!=1){tmpx*=tmp;tmp=0;ans=ans%10000;ans+=tmpx%10000;ans=ans%10000;tmpx=1;}
else
{ ans=ans%10000;
ans+=tmp%10000;
ans=ans%10000;
tmp=0;
}
}
if(buf=='*'){
tmpx*=tmp;
tmpx=tmpx%10000;
ans=ans%10000;
tmp=0;
}
}
if(tmpx!=1){tmpx*=tmp;ans+=tmpx;}
else{ans+=tmp%10000;ans=ans%10000;}
cout<<ans%10000;
return 0;
}