A. Gotta Catch Em' All!

time limit per test
1 second
memory limit per test

256 megabytes

input

standard input

output

standard output

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

 //2017.01.18
#include <iostream>
#include <cstdio>
#include <cstring> using namespace std; const int inf = 0x3f3f3f3f;
int book[]; int main()
{
string str;
string bul = "Bulbbasaur";
while(cin >> str)
{
memset(book, , sizeof(book));
for(int i = ; i < str.length(); i++)
book[str[i]]++;
book['u']/=;
book['a']/=;
int ans = inf;
for(int i = ; i < bul.length(); i++)
if(ans > book[bul[i]])
ans = book[bul[i]];
cout<<ans<<endl;
} return ;
}

CodeForces757A的更多相关文章

随机推荐

  1. Android编程中的5种数据存储方式

    Android编程中的5种数据存储方式 作者:牛奶.不加糖 字体:[增加 减小] 类型:转载 时间:2015-12-03我要评论 这篇文章主要介绍了Android编程中的5种数据存储方式,结合实例形式 ...

  2. Tomcat 静态部署 二步特别注意

    一.修改server.xml 在Host 节点添加如下配置 <!-- path 为请求url地址 docBase 为项目文件绝对地址制定到WebContent根目录下 --> <Co ...

  3. 配置 nginx location 实时查看 php-fpm 的状态

    在Nginx.conf 里配置 location ~ ^/status$ { include fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_ ...

  4. 关于 HTML5、Jquery、Phonegap 跨域问题的研究

    近期研究Phonegap的相关技术,遇到了服务资源访问的跨域.经过尝试使用服务器端的代理,Phonegap打包后不能够访问到相应资源.在搜索引擎的帮助下,找到了Jquery的jsonp的方式,尝试发现 ...

  5. RestTemplate 发送Post 多个参数请求

    MultiValueMap<String, String> requestEntity = new LinkedMultiValueMap<>(); requestEntity ...

  6. 关于iOS后台模式

    https://onevcat.com/2013/08/ios7-background-multitask/ http://zhidao.baidu.com/link?url=NUOMrLGB6Odr ...

  7. matlab unique 顺序不变

    对于一个向量,使用unique去重后会自动排序,为了保持原顺序: A = [5,1,8,5,2,8,3,9,6,1];[i,j] = unique(A,'first');B = A(sort(j)); ...

  8. 增量式PID的stm32实现(转)

    源:增量式PID的stm32实现,整定过程 首先说说增量式PID的公式,这个关系到MCU算法公式的书写,实际上两个公式的写法是同一个公式变换来得,不同的是系数的差异. 资料上比较多的是: 还有一种是: ...

  9. 【蓝牙数据采集模块】-02-Sensor Controller 编写CC2650STK外设驱动

    上次说到把所有的传感器模块在Sensor Controller中实现读写,并封装驱动. 先来看一下CC2650STK的原理图 用红色方框标记的DIO_0~DIO_7, DIO_23~DIO_30是可以 ...

  10. centOS IP能ping通但是域名ping不通

    centOS IP能ping通但是域名ping不通, 导致了yum update 无更新. 百度了很久,最后有个方法试过解决了: iptables -X iptables -F 然后重新 yum up ...