// yukicoder: No.495 (^^*) Easy // 2019.4.16 bal4u #include #if 1 #define gc() getchar_unlocked() #else #define gc() getchar() #endif void ins(char *s) // 文字列の入力 スペース以下の文字で入力終了 { do *s = gc(); while (*s++ > ' '); *(s - 1) = 0; } char S[100005], *p = S+1; int main() { int l = 0, r = 0; ins(S); while (*p) { if (*p == '^') l++; else r++; p += 5; } printf("%d %d\n", l, r); return 0; }