#P1321. 单词覆盖还原

单词覆盖还原

Description

I have a string of length ll, which initially consists of ll periods ('.').

I repeatedly paste the words boy or girl onto this string in order.

Words pasted later will overwrite previously pasted words or periods. In the end, each word has at least one character that is not overwritten.

How many boy and how many girl were pasted in total?

Input Format

A single line: the string after repeatedly pasting the words boy and girl.

Output Format

Two lines, each with one integer. The first line is the count of boy, and the second line is the count of girl.

......boyogirlyy......girl.......

4
2

Hint

It is guaranteed that 3l2553\le l\le255, and the string contains only the following characters: .bgilory\texttt{.bgilory}.

Translated by ChatGPT 5