#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
  int a,b,n;
  a=0;
  b=0;
  string s;
  cin >> s;
  n=s.size();
  string t="(^^*)";
  for(int i=0;i<=n;i=i+5){
    if(s[i]=='#')
      break;
    if(s[i+1]=='^')
      a++;
    else
      b++;
  }
  cout<<a<<" "<<b<<endl;
  return 0;
}