#include #include #include #include int main(){ char l[1001]; unsigned long long p = 0; while(scanf("%s", l) == 1){ if(l[0] == 124){ //printf("rack: %d\n", strlen(l)); p += strlen(l) * 42; } else { int n = 0; sscanf(l, "%d,-|||", &n); int len = 1; int c = n; while( c /= 10 ) len++; //printf("len: %d\n", strlen(l) - (len + 3)); int bars = strlen(l) - (len + 2); if(bars < 1) bars = 1; p += n * bars; } } p = ceil(p / 10.0) * 10; printf("%llu,-", p); }