Gotta Catch Em All!
Time Limit: 1 Sec Memory Limit: 128 MB
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.

传送门:CF757A

Input

Input contains a single line containing a string s (1≤|s|≤105) — 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. .

Output

Output a single integer, the answer to the problem.

Sample Input

1
Bulbbasaur

Sample Output

1
1

题解

无所谓顺序,记录每个字母出现的个数再判断就行了 别看错单词就行= =
## AC code:(不包含输入类)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.io.*;  
import java.util.*;
public class Main {

public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
while(sc.hasNext()){
String s=sc.nextLine();
int[] js=new int[7];
for(int i=0;i<s.length();i++) {
if(s.charAt(i)=='B')js[0]++;
else if(s.charAt(i)=='u')js[1]++;
else if(s.charAt(i)=='l')js[2]++;
else if(s.charAt(i)=='b')js[3]++;
else if(s.charAt(i)=='a')js[4]++;
else if(s.charAt(i)=='s')js[5]++;
else if(s.charAt(i)=='r')js[6]++;
}
int count=0;
while(js[0]>=1&&js[1]>=2&&js[2]>=1&&js[3]>=1&&js[4]>=2&&js[5]>=1&&js[6]>=1){
js[0]-=1;
js[1]-=2;
js[2]-=1;
js[3]-=1;
js[4]-=2;
js[5]-=1;
js[6]-=1;
count++;
}
System.out.println(count);
}
}
}