#include #include #include #include #include using namespace std; int main() { ios::sync_with_stdio(0); int cnt = 0; // char s[1001]; string s; while (cin >> s) { if (s[0] == '|') { cnt += 42 * s.size(); } else { int len = s.size(); int cut = 0; for (int i = 0; i < len; i++) { if (isdigit(s[i])) { cut++; } else { break; } } // s[cut] = '\0'; int n = stoi(s.substr(0, cut)); len = len - cut - 2; cnt += n * (len ? len : 1); } } // if (cnt == 0) { // cout << "0,-" << endl; // return 1; // } // if (cnt < 10) { // cout << "10,-" << endl; // return 1; // } if (cnt % 10 == 0) { cout << cnt << ",-" << endl; } else { cout <<( (cnt/10) + 1 ) * 10<< ",-" << endl; } // cout << ((cnt +5)/ 10)*10 << ",-" << endl; return 0; }