#include #include #include #include #include #include #include using namespace std; using uint = unsigned int; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define GETLINE( A ) string A; getline( cin , A ) #define FOR_ITR( ARRAY , ITR , END ) for( auto ITR = ARRAY .begin() , END = ARRAY .end() ; ITR != END ; ITR ++ ) int main() { CIN( string , S ); const string X = "*"; const string A = "^"; ll L = 0; ll R = 0; const uint& size = S.size(); for( uint i = 0 ; i < size ; i++ ){ const string c = S.substr( i , 1 ); if( c == X ){ if( S.substr( i - 1 , 1 ) == A ){ L++; } else { R++; } } } const string answer = to_string( L ) + " " + to_string( R ); cout << answer << endl; return 0; }