#include #include using namespace std; int main() { int totalPrice = 0, price, count; string bars; // svislitka char c; bool beers; //nacitani vstupu ios_base::sync_with_stdio(false); while(!cin.eof()) { beers = true; if(cin.eof()) { break; } cin >> price; if(cin.eof()) { break; } if(cin) { cin >> c >> c; // nacteni znaku ,- beers = false; } cin.clear(); if(cin.eof()) { break; } cin >> bars; if(cin.eof()) { break; } count = bars.length(); if(beers) { totalPrice += count * 42; } else { totalPrice += count * price; } } totalPrice = round(totalPrice / 10.0) * 10; cout << totalPrice << ",-" << endl; return 0; }