#include using namespace std; #define EPS (1e-10) #define REP (i,n) for (int i = 0; i<(n);i++) typedef long double ld; typedef long long ll; typedef pair ii; typedef pair dd; typedef vector vi; typedef vector vll; typedef vector vd; int main() { ios::sync_with_stdio(false); string s; long long res = 0; while(cin >> s) { long ad = 0; if (s[0] == '|') ad = 42*s.length(); else { int i = 0; while (s[i] != ',')++i; long long p = 0; for(int j = 0; j < i; ++j) { p *= 10; p += s[j] - '0'; } ad = p * (s.length()-i-2); } // cout << ad << endl; res += ad; } if (res%10 > 0) res = res+10-(res%10); cout << res << ",-" << endl; }