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