#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef unsigned u; typedef vector vi; typedef pair pii; #define F first; #define S second; #define PB push_back; #define MP make_pair; bool EQ(double a, double b) { return (fabs(a-b) / (a+b) < DBL_EPSILON); } int scanLines(){ char tmp; int counter = 0; while (scanf("%c", &tmp) == 1 && tmp == '|') { ++counter; } return counter; } int main( ) { int sum = 0; int price; int output; while(true) if((output = scanf("%d", &price) )!= 1 ) { if(output == EOF){ if(sum % 10 == 0) printf("%d,-\n", sum); else printf("%d,-\n", 10*((sum/10)+1)); return 0; } sum += scanLines() * 42; } else { scanf(",-"); sum += scanLines() * price; } return 0; } // // Created by cteam038 on 10/19/19. //