#include #include #include using namespace std; int lg; char vars[105], type[105]; int main() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); #endif // ONLINE_JUDGE while(cin >> type) { if(strcmp(type, "unsigned") == 0) { cin >> type; } cin >> vars; lg = strlen(vars); int nr = 0, total = 0, pretot = 1; for(int i = 0; i < lg; ++i) { if(vars[i] == ']') { pretot *= nr; nr = 0; } if(vars[i] >= '0' && vars[i] <= '9') { nr = nr * 10 + vars[i] - '0'; } if(vars[i] == ',') { total += pretot; pretot = 1; } } total += pretot; if(strcmp(type, "short") == 0) total <<= 1; if(strcmp(type, "int") == 0) total <<= 2; cout << total << '\n'; } return 0; }