/*
#include<stdio.h>
#include<string.h>
int stack[201], top=-1;
void push(int k)
{
top++;
stack[top]=k;
}
int pop()
{
return stack[top--];
}
void view()
{
printf("stack>> ");
for(int i=0;i<=top;i++)
{
printf("%d ",stack[top]);
}
printf("\n");
}
int main()
{
char str[201]={};
int i=0, sum=0, p, q, m;
gets(str);
while(str[i]!=NULL)
{
if(str[i]=='+')
{
push(pop()+pop());
}
else if(str[i]=='-')
{
p=pop();
q=pop();
push(q-p);
}
else if(str[i]=='*')
{
push(pop()*pop());
}
else if(str[i]!=' ')
{
sum=0;
while(str[i]!=' ')
{
sum=sum*10+str[i]-'0';
i++;
}
push(sum);
}
i++;
}
printf("%d", pop());
return 0;
}*/
#include<stdio.h>
#include<string.h>
char stack[31];
int top=-1, n=0, m=0;
void push(char k)
{
top++;
stack[top]=k;
}
int pop(int m, int n)
{
if(m!=n)
return 0;
else
return stack[top--];
}
int main()
{
int i=0, n=0, m=0, p, u;
char str[31];
gets(str);
while(str[i]!=-1)
{
if(str[i]==')')
{
m++;
}
else if(str[i]=='(')
{
n++;
}
i++;
}
while(str[i]!=-1)
{
if(str[i]=='(')
{
if(str[i+1]==')')
{
}
else if(str[i+1]=='(')
{
continue;
}
else if(str[i+1]=='[')
{
if(str[i+2]==']')
{
}
}
}
i++;
}
}