#include using namespace std; int main() { int ans1 = 0, ans2 = 0; char c, pre_c = 'a'; while (cin >> c) { if (c == '*') { (pre_c == '^' ? ans1 : ans2)++; } pre_c = c; } cout << ans1 << ' ' << ans2 << endl; }