#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; struct BoolName : numpunct { string t, f; BoolName (string t = "Yes", string f = "No") : t(t), f(f) {} string do_truename() const {return t;} string do_falsename() const {return f;} }; struct Initializer { Initializer() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(15) << boolalpha; cout.imbue(locale(cout.getloc(), new BoolName)); } } initializer; template istream& operator>>(istream &s, vector &v) { for (T &t : v) s >> t; return s; } template ostream& operator<<(ostream &s, const vector &v) { for (const T &t : v) s << t << endl; return s; } void set_bool_name(string t, string f) { cout.imbue(locale(cout.getloc(), new BoolName(t, f))); } vector find_all(const string &s1, const string& s2) { vector res; auto pos = s1.find(s2); while (pos != string::npos) { res.emplace_back(pos); pos = s1.find(s2, pos + 1); } return res; } int main() { string s; cin >> s; auto v = find_all(s, "(^^*)"); auto u = find_all(s, "(*^^)"); cout << v.size() << " " << u.size() << endl; }