#include<iostream>
#include<vector>

using namespace std;

int main(){

   string S;
   cin>> S;

   int ans[]={0, 0};
   for(int i=0; i<S.size(); i++){
      if(S[i]=='('){
         int L=0, R=0;
         string l, r;
         for(int j=i+1; j<S.size(); j++){
            char c=S[j];
            if(l.empty()&&c=='*') l+='*';
            else if(l=="*"&&c=='^') l+='^';
            else if(l=="*^"&&c=='^') l+='^';
            if(r.empty()&&c=='^') r+='^';
            else if(r=="^"&&c=='^') r+='^';
            else if(r=="^^"&&c=='*') r+='*';
            if(c==')'&&l=="*^^") L++;
            if(c==')'&&r=="^^*") R++;
         }
         ans[0]+=L;
         ans[1]+=R;
      }
   }

   cout<< ans[1]<< " "<< ans[0]<< endl;

   return 0;
}