#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using P = pair; int main(void) { string s; cin >> s; int n = 1, l = 0, r = 0; if(s.size()==1) { cout << 0 << " " << 0 << endl; return 0; } while (n < s.size()) { if (s[n] == '^') l++; else r++; n += 5; } cout << l << " " << r << endl; return 0; }