i;main(p,l){char*q;for(;p=gets(l);puts(l))for(;q=p=index(p,40);bcopy(q,q+1,99),*q=40)for(*q=32;i-=*--q%5*2%3-1;);}