#include #include #include using namespace std; string s; char d[120]; int k; int solve(char p[]) { int ans=1, prod=0; char *q=p; q=strchr(q, '['); if(q==NULL) return 1; q++; while(*q!='\0') { if(*q==']') ans*=prod, prod=0; if(*q!='[' && *q!=']') prod=prod*10+*q-'0'; q++; } return ans; } int main() { // freopen("in.txt", "r",stdin); while(cin>>s) { if(s=="unsigned") cin>>s; if(s=="char") k=1; if(s=="int") k=4; if(s=="short") k=2; int ans=0; cin>>d; char *p, *q; p=d; do { q=strchr(p, ','); if(q!=NULL) *q=NULL; ans+=solve(p); p=q+1; }while(q!=NULL); cout<