
#include<string>
#include <iostream>
#include <stack>
using namespace std;
bool solution(string s)
{
bool answer = true;
stack <char> st;
int i;
for(i = 0; i < s.length(); i++){
if(st.empty()){
st.push(s[i]);
}
else{
if(s[i] == '('){
cout << "push() ";
st.push(s[i]);
}
if(s[i] == ')'){
cout << "pop() ";
st.pop();
}
}
}
if(st.empty()){
cout << "\n" << st.size() << "\n";
answer = true;
}
else{
answer = false;
}
return answer;
}