#include using namespace std; typedef long long ll; typedef vector< int > vi; typedef vector< vi > vvi; typedef vector< ll > vl; typedef vector< vl > vvl; typedef pair< int, int > pii; typedef vector< pii > vp; template< class T1, class T2 > int upmin( T1 &x, T2 v ){ if( x > v ){ x = v; return 1; } return 0; } template< class T1, class T2 > int upmax( T1 &x, T2 v ){ if( x < v ){ x = v; return 1; } return 0; } const int INF = 0x3f3f3f3f; const string face[] = { "(^^*)", "(*^^)" }; string S; void init(){ cin >> S; } void preprocess(){ } void solve(){ int ans[ 2 ] = { 0, 0 }; int ptr[ 2 ] = { 0, 0 }; for( int i = 0; i < S.size(); ++i ) for( int j = 0; j < 2; ++j ){ if( face[ j ][ ptr[ j ] ] == S[ i ] ) ++ptr[ j ]; if( ptr[ j ] == 5 ) ptr[ j ] = 0, ++ans[ j ]; } cout << ans[ 0 ] << " " << ans[ 1 ] << endl; } signed main(){ ios::sync_with_stdio( 0 ); init(); preprocess(); solve(); return 0; }