#include <bits/stdc++.h>
using namespace std;
int main() {
stack<int> s;
int a, tmp = 0;
char b;
cin >> a;
s.push(a);
while (cin >> b >> a) {
a %= 100000;
if (b == '+') {
s.push(a);
} else if (b == '*') {
tmp = s.top();
s.pop();
s.push(tmp * a);
}
}
while (s.size() > 0) {
tmp += s.top();
s.pop();
}
tmp %= 10000;
cout << tmp;
return 0;
}
6、7行别看,调试用的