#include #include int main() { bool d = true; size_t x, y, s = 0; while (scanf("%*[^dm]") != EOF) { if (getchar() == 'd') { int c; #define unless(i) if ((c = getchar()) != i && ungetc(c, stdin) == c) unless ('o') continue; unless ('(') { if (scanf("n't()") != EOF) d = false; continue; } unless (')') continue; #undef unless d = true; } if (scanf("ul(%3zu,%3zu", &x, &y) == 2 && getchar() == ')' && d) s += x * y; } printf("%zu\n", s); return 0; }