#include using namespace std; int main() { int a = 0, b = 0; string s; cin >> s; for (int i = 0; i < s.length(); i++) { a += (s.substr(i, 2) == "^*"); b += (s.substr(i, 2) == "*^"); } cout << a << " " << b << endl; return 0; }