Codecraft-17 and Codeforces Round 391 (Div. 1 + Div. 2, combined)
A
Gotta Catch Em' All!
Codeforces
1000
原题
←B →
翻译中…

Bash wants to become a Pokemon master one day. Although he liked a lot of Pokemon, he has always been fascinated by Bulbasaur the most. Soon, things started getting serious and his fascination turned into an obsession. Since he is too young to go out and catch Bulbasaur, he came up with his own way of catching a Bulbasaur.

翻译中…

Each day, he takes the front page of the newspaper. He cuts out the letters one at a time, from anywhere on the front page of the newspaper to form the word "Bulbasaur" (without quotes) and sticks it on his wall. Bash is very particular about case — the first letter of "Bulbasaur" must be upper case and the rest must be lower case. By doing this he thinks he has caught one Bulbasaur. He then repeats this step on the left over part of the newspaper. He keeps doing this until it is not possible to form the word "Bulbasaur" from the newspaper.

翻译中…

Given the text on the front page of the newspaper, can you tell how many Bulbasaurs he will catch today?

翻译中…

Note: uppercase and lowercase letters are considered different.

翻译中…

Input

翻译中…

Input contains a single line containing a string $*s*$ ($1  ≤  |*s*|  ≤  10^{5}$) — the text on the front page of the newspaper without spaces and punctuation marks. $|*s*|$ is the length of the string $*s*$.

翻译中…

The string $*s*$ contains lowercase and uppercase English letters, i.e. image.

翻译中…

Output

翻译中…

Output a single integer, the answer to the problem.

翻译中…

Note

翻译中…

In the first case, you could pick: Bulbbasaur.

翻译中…

In the second case, there is no way to pick even a single Bulbasaur.

翻译中…

In the third case, you can rearrange the string to BulbasaurBulbasauraddrgndgddgargndbb to get two words "Bulbasaur".

翻译中…

样例

Input #1
Bulbbasaur
Output #1
1
InputCopy OutputCopy
Input #2
F
Output #2
0
InputCopy OutputCopy
Input #3
aBddulbasaurrgndgbualdBdsagaurrgndbb
Output #3
2
InputCopy OutputCopy
题目信息
题号
757A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。