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|  ≤  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.

Examples
input
Bulbbasaur
output
1
input
F
output
0
input
aBddulbasaurrgndgbualdBdsagaurrgndbb
output
2
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".

题意:没啥好说的

解法:根据出现的字母,看能不能组合出来就行

 #include <bits/stdc++.h>
using namespace std;
string s;
map<char,int>Mp;
int MAX=(<<)-;
//Bulbasaur
int main()
{
cin>>s;
int len=s.length();
for(int i=;i<len;i++){
Mp[s[i]]++;
}
MAX=min({MAX,Mp['B'],Mp['u']/,Mp['l'],Mp['b'],Mp['a']/,Mp['s'],Mp['r']});
cout<<MAX<<endl;
return ;
}

Codecraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) A的更多相关文章

  1. Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题

    Educational Codeforces Round 71 (Rated for Div. 2)-E. XOR Guessing-交互题 [Problem Description] ​ 总共两次询 ...

  2. Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...

  3. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  4. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

  5. Educational Codeforces Round 35 (Rated for Div. 2)

    Educational Codeforces Round 35 (Rated for Div. 2) https://codeforces.com/contest/911 A 模拟 #include& ...

  6. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) F. Isomorphic Strings 题目连接: http://cod ...

  7. Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes

    Codeforces Educational Codeforces Round 44 (Rated for Div. 2) E. Pencils and Boxes 题目连接: http://code ...

  8. Educational Codeforces Round 63 (Rated for Div. 2) 题解

    Educational Codeforces Round 63 (Rated for Div. 2)题解 题目链接 A. Reverse a Substring 给出一个字符串,现在可以对这个字符串进 ...

  9. Educational Codeforces Round 39 (Rated for Div. 2) G

    Educational Codeforces Round 39 (Rated for Div. 2) G 题意: 给一个序列\(a_i(1 <= a_i <= 10^{9}),2 < ...

  10. Educational Codeforces Round 48 (Rated for Div. 2) CD题解

    Educational Codeforces Round 48 (Rated for Div. 2) C. Vasya And The Mushrooms 题目链接:https://codeforce ...

随机推荐

  1. Linux_异常_03_Failed to restart iptables.service: Unit not found.

    启动防火墙时出现: Failed to restart iptables.service: Unit not found. 解决方案: 1.https://stackoverflow.com/ques ...

  2. oracle中导出sql的几个常见词语的意思

    set feedback off不显示反馈信息  “1行已插入”,大量数据装入时,显示这个也是很浪费资源和时间的. set define off 如果你某个字段里面有&字符,插入数据会出错,设 ...

  3. 制定一套适合自己团队的GITflow标准化工作流

    Git作为分布式代码管理的“当红炸子鸡”,被越来越多团队使用.当团队多个人员在同一个Git仓库上进行代码开发,没有一套标准化流程,将会引起代码管理的混乱,上线流程的迷茫,影响工作效率.制定一套适合自己 ...

  4. kindle 3 webbrowser破解,

    首先下载破解: http://183.60.157.10/down_group83/M00/06/31/tzydCk3MyHYAAAAAAUTLHFYI-wk8562757/webpatch.7z?k ...

  5. exosip 和 pjsip 简介

     oSIP oSIP的开发开始于2000年7月,第一个版本在2001年5月发 布,到现在已经发展到3.x了.它采用ANSI C编写,而且结 构简单小巧,所以速度特别快,它并不提供高层的SIP会话 控制 ...

  6. valgrind 代码检查,内存泄漏

    使用平台 linux 下载 http://valgrind.org/ 文档 http://valgrind.org/docs/manual/manual.html 博客 https://www.osc ...

  7. 1.改变项目 动态库、静态库属性。 2.使用运行库 /MD、/MT、/LD说明

    /MD./MT./LD(使用运行库) 有关 C 运行库以及使用 /clr(公共语言运行时编译) 进行编译时要使用哪些库的更多信息,请参见 CRT 库功能. 传递给链接器的给定调用的所有模块都必须使用相 ...

  8. 面向对象——final关键字

    继承的弊端:打破了封装性 解决方式:final final关键字的特点: 1.final是一个修饰符,即可以修饰类,也可以修饰方法,还可以修饰变量 2.final修饰的类不可以被继承 3.final修 ...

  9. tomcat 开机自启方法

    1.把下面的代码保存为tomcat文件,并让它成为可执行文件 chmod 755 tomcat. #!/bin/bash # # /etc/rc.d/init.d/tomcat # init scri ...

  10. wpf窗口禁止最大化但允许调整大小

    wpf中窗口禁止最大化可以通过属性ResizeMode来设置,但是ResizeMode有一个问题就是如果ResizeMode设置为NoResize的话,是可以禁止最大化的,但是这样同时也就不能拖动调整 ...