#include using namespace std; int main(){ string s; cin >> s; int l=0,r=0; for(int i=1; i < s.size(); i+=5){ if(s[i] == '^') l++; else r++; } cout << l << " " << r << " " << endl; }