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. $s_{i} \in \{a, b, \ldots, z, A, B, \ldots, Z \}$.


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

Source: codeforces | Difficulty: EASY
Tags: Implementation


Solutions:
q = input('')
z = 'lbasaur'
x = 0
g = 0
w = q.count('B')
e = q.count('u')
e = e // 2
if w <= e:
	g = w
if w >= e:
	g = e
for r in range(7):
	e = q.count(z[x])
	if z[x] == 'a' or z[x] == 'u':
		e = e // 2
	x = x + 1
	if g <= e:
		g = g
	if g >= e:
		g = e
print(g)


b = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
minn = 100500
s = input()
for el in s:
	if el in 'Bulbasaur':
		b[el] += 1
for key in b:
	if key in ('a', 'u'):
		minn = min(minn, b[key] // 2)
	else:
		minn = min(minn, b[key])
print(minn)


from collections import Counter
s = input()
d = Counter(s)
b = Counter('Bulbasaur')
x = [d[k] // b[k] for k in b.keys()]
print(min(x))


n = input()
(a, b, u, B, l, s, r) = (0, 0, 0, 0, 0, 0, 0)
for i in range(len(n)):
	if n[i] == 'B':
		B += 2
	if n[i] == 'a':
		a += 1
	if n[i] == 'u':
		u += 1
	if n[i] == 'b':
		b += 2
	if n[i] == 'l':
		l += 2
	if n[i] == 's':
		s += 2
	if n[i] == 'r':
		r += 2
print(min(a, b, u, B, l, s, r) // 2)


w = input()
c = [w.count(l) for l in 'Bulbasr']
c[1] //= 2
c[4] //= 2
print(min(c))


s = input()
d = {}

def get(x):
	if x in d:
		return d[x]
	else:
		return 0
for i in s:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
name = 'Bulbasr'
cnt = [1, 2, 1, 1, 2, 1, 1]
ans = 1000000
for i in range(len(name)):
	ans = min(ans, get(name[i]) / cnt[i])
print(int(ans))


import collections

def main():
	s = input()
	cou = collections.Counter(s)
	bul = 'Bulbasaur'
	cou2 = collections.Counter(bul)
	res = 10 ** 9
	for item in cou2:
		res = min(res, cou[item] // cou2[item])
	print(res)
main()


ch = input()
B = 0
b = 0
u = 0
l = 0
a = 0
s = 0
r = 0
for i in range(len(ch)):
	if ch[i] == 'B':
		B = B + 1
	elif ch[i] == 'b':
		b = b + 1
	elif ch[i] == 'u':
		u = u + 1
	elif ch[i] == 'l':
		l = l + 1
	elif ch[i] == 'a':
		a = a + 1
	elif ch[i] == 's':
		s = s + 1
	elif ch[i] == 'r':
		r = r + 1
x = min(B, l, r, s, b)
y = min(u, a)
if y >= x * 2:
	print(x)
elif y < x * 2:
	print(y // 2)
else:
	print(0)


S = list(input())
(B, u, l, b, a, s, r) = (0, 0, 0, 0, 0, 0, 0)
for i in range(len(S)):
	if S[i] == 'B':
		B += 1
	elif S[i] == 'u':
		u += 1
	elif S[i] == 'l':
		l += 1
	elif S[i] == 'b':
		b += 1
	elif S[i] == 'a':
		a += 1
	elif S[i] == 's':
		s += 1
	elif S[i] == 'r':
		r += 1
u = u / 2
a = a / 2
print(int(min(B, u, l, b, a, s, r)))


k = 'Bulbasaur'
s = input()
dict1 = {}
for i in s:
	if i in k:
		if i in dict1:
			dict1[i] += 1
		else:
			dict1[i] = 1
min1 = 9999999999
if len(dict1) < 7:
	print(0)
	exit(0)
dict1['a'] //= 2
dict1['u'] //= 2
for i in dict1:
	min1 = min(min1, dict1[i])
if min1 == 9999999999:
	print(0)
else:
	print(min1)


s = str(input())
note = dict()
for i in ('B', 'b', 'l', 's', 'r', 'u', 'a'):
	note.setdefault(i, 0)
for i in s:
	if i in ('B', 'b', 'l', 's', 'r', 'u', 'a'):
		note[i] += 1
note['u'] //= 2
note['a'] //= 2
print(min(note.values()))


inp = input()
B = 0
u = 0
l = 0
b = 0
a = 0
s = 0
r = 0
for i in inp:
	if i == 'B':
		B += 1
	elif i == 'u':
		u += 1
	elif i == 'l':
		l += 1
	elif i == 'b':
		b += 1
	elif i == 'a':
		a += 1
	elif i == 's':
		s += 1
	elif i == 'r':
		r += 1
print(min(B, u // 2, l, b, a // 2, s, r))


bulba = input()
zavr = [0] * 7
zavr[0] = bulba.count('B')
zavr[1] = bulba.count('u') // 2
zavr[2] = bulba.count('l')
zavr[3] = bulba.count('b')
zavr[4] = bulba.count('a') // 2
zavr[5] = bulba.count('s')
zavr[6] = bulba.count('r')
print(min(zavr))


word = input()
B = 0
u = 0
l = 0
b = 0
a = 0
s = 0
r = 0
for i in range(len(word)):
	if word[i] == 'B':
		B += 1
	elif word[i] == 'u':
		u += 1
	elif word[i] == 'l':
		l += 1
	elif word[i] == 'b':
		b += 1
	elif word[i] == 'a':
		a += 1
	elif word[i] == 's':
		s += 1
	elif word[i] == 'r':
		r += 1
u //= 2
a //= 2
x = min(B, u, l, b, a, s, r)
print(x)


required = {'B': 1, 'u': 2, 'l': 1, 'b': 1, 'a': 2, 's': 1, 'r': 1}
s = input()
has = {}
for i in s:
	has[i] = has.get(i, 0) + 1
B_count = s.count('B')
can = 0
for i in range(1, B_count + 1):
	cannot = False
	for (k, v) in required.items():
		if k in has and v * i <= has[k]:
			continue
		else:
			cannot = True
			break
	if cannot:
		break
	can += 1
print(can)


s = input()
num_B = s.count('B')
num_a = s.count('a') // 2
num_b = s.count('b')
num_l = s.count('l')
num_r = s.count('r')
num_u = s.count('u') // 2
num_s = s.count('s')
print(min([num_B, num_a, num_b, num_l, num_r, num_u, num_s]))


(s, t) = (input(), 'Bulbasaur')
print(min([s.count(c) // t.count(c) for c in t]))


a = input()

def cou(x):
	t = 0
	for y in a:
		if y == x:
			t = t + 1
	return t
print(min(cou('B'), int(cou('u') / 2), cou('l'), cou('b'), cou('r'), cou('s'), int(cou('a') / 2)))


from collections import Counter
t = 'Bulbasaur'
l = list(input())
c = Counter(l)
z = float('inf')
d = {t[i]: 0 for i in range(len(t))}
for i in c:
	if i in d:
		if i == 'a' or i == 'u':
			d[i] = c[i] // 2
		else:
			d[i] = c[i]
for i in d:
	z = min(z, d[i])
print(z)


s = input()
dic = dict()
s1 = 'Bulbasr'
for i in s1:
	dic[i] = 0
for i in s:
	if i in s1:
		dic[i] += 1
dic['u'] = dic['u'] // 2
dic['a'] = dic['a'] // 2
print(min(dic.values()))


n = input()
d = dict()
d['B'] = 0
d['u'] = 0
d['l'] = 0
d['b'] = 0
d['a'] = 0
d['s'] = 0
d['a'] = 0
d['u'] = 0
d['r'] = 0
for j in n:
	if j in d:
		d[j] += 1
ans = min(d['B'], d['u'] // 2, d['l'], d['b'], d['s'], d['r'], d['a'] // 2)
print(ans)


s = input().strip()
freq = {}
for i in s:
	if i not in freq.keys():
		freq[i] = 1
	else:
		freq[i] += 1
ans = 999999999
for i in 'Bulbsar':
	if i not in freq.keys():
		ans = 0
		break
	if i in 'au':
		ans = min(ans, freq[i] // 2)
	else:
		ans = min(ans, freq[i])
print(ans)


s = input()
a = ''
b = 0
l = len(s)
if 'B' in s:
	b += 1
	m = s.count('B')
	a = a + m * s[s.find('B')]
	s = s.replace(s[s.find('B')], '')
	if 'u' in s:
		b += 1
		m = s.count('u')
		a = a + m * s[s.find('u')]
		s = s.replace(s[s.find('u')], '')
		if 'l' in s:
			b += 1
			m = s.count('l')
			a = a + m * s[s.find('l')]
			s = s.replace(s[s.find('l')], '')
			if 'b' in s:
				b += 1
				m = s.count('b')
				a = a + m * s[s.find('b')]
				s = s.replace(s[s.find('b')], '')
				if 'a' in s:
					b += 1
					m = s.count('a')
					a = a + m * s[s.find('a')]
					s = s.replace(s[s.find('a')], '')
					if 's' in s:
						b += 1
						m = s.count('s')
						a = a + m * s[s.find('s')]
						s = s.replace(s[s.find('s')], '')
						if 'r' in s:
							b += 1
							m = s.count('r')
							a = a + m * s[s.find('r')]
							s = s.replace(s[s.find('r')], '')
k = min(a.count('B'), a.count('l'), a.count('b'), a.count('s'), a.count('r'))
k2 = int(min(a.count('u'), a.count('a')) / 2)
print(min(k, k2))


l = input()
w = [0, 0, 0, 0, 0, 0, 0]
for i in range(len(l)):
	if l[i] == 'B':
		w[0] = w[0] + 1
	elif l[i] == 'u':
		w[1] = w[1] + 1
	elif l[i] == 'l':
		w[2] = w[2] + 1
	elif l[i] == 'b':
		w[3] = w[3] + 1
	elif l[i] == 'a':
		w[4] = w[4] + 1
	elif l[i] == 's':
		w[5] = w[5] + 1
	elif l[i] == 'r':
		w[6] = w[6] + 1
w[1] = w[1] // 2
w[4] = w[4] // 2
print(min(w))


s = input()
d = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
for x in s:
	if x in d:
		d[x] += 1
c = 1000000
for x in d:
	if x != 'u' and x != 'a':
		c = min(c, d[x])
	else:
		c = min(c, d[x] // 2)
print(c)


s = input()
N = len(s)
t = 'Bulbbasaur'
t1 = 'Bulbsar'
d = {}
M = len(t)
num = 0
for i in range(N):
	if s[i] in d:
		d[s[i]] += 1
	else:
		d[s[i]] = 1
num = float('inf')
for j in t1:
	if j in d:
		if j not in ['a', 'u']:
			num = min(num, d[j])
		else:
			num = min(num, d[j] // 2)
	else:
		print(0)
		exit()
print(num)


s = input()
a = s.count('a') // 2
B = s.count('B')
u = s.count('u') // 2
b = s.count('b')
c = s.count('s')
r = s.count('r')
l = s.count('l')
print(min(B, u, l, b, a, c, r))


from collections import Counter
s = input()
keyw = 'Bulbasaur'
key_c = Counter(keyw)
text_c = Counter(s)
ans = float('inf')
for c in key_c.keys():
	ans = min(ans, text_c[c] // key_c[c])
print(ans)


s = input()
ans = min(s.count('B'), s.count('u') / 2, s.count('l'), s.count('b'), s.count('a') / 2, s.count('s'), s.count('r'))
print(int(ans))


import collections
s = input()
d = collections.defaultdict(lambda : 0)
for i in s:
	d[i] += 1
a = 'Bulbsar'
d['a'] //= 2
d['u'] //= 2
m = d['B']
for i in a:
	m = min(m, d[i])
print(m)


s = input()
B = s.count('B')
u = s.count('u') // 2
l = s.count('l')
b = s.count('b')
a = s.count('a') // 2
s1 = s.count('s')
r = s.count('r')
Bulbasaur = [B, u, l, b, a, s1, r]
print((min(Bulbasaur) - min(Bulbasaur) % 1) // 1)


(s, ss) = (input(), 'Bulbasr')
a = [s.count('u') // 2, s.count('a') // 2]
print(min(list((s.count(i) for i in ss)) + a))


import collections
s = input()
d = collections.defaultdict(int)
for c in s:
	d[c] += 1
b = 'Bulbasr'
ret = d['B']
for char in b:
	ret = min(ret, d[char])
ret = min(ret, int(d['u'] / 2))
ret = min(ret, int(d['a'] / 2))
print(str(ret))


from collections import Counter

def main():
	s = input()
	c = Counter(s)
	w = Counter('Bulbasaur')
	ans = 1000000000.0
	for char in w:
		ans = min(ans, c[char] // w[char])
	print(ans)
main()


cnt = 0
s = input()
print(min(min((s.count(el) for el in 'Blbsr')), s.count('a') // 2, s.count('u') // 2))


line = input()
pokemon = 'Bulbasr'
temp = [0, 0, 0, 0, 0, 0, 0]
for i in line:
	if i in pokemon:
		x = 0
		for j in pokemon:
			if i == j:
				temp[x] += 1
				break
			else:
				x += 1
temp[1] //= 2
temp[4] //= 2
pokesNum = temp[0]
for i in range(1, 7):
	if temp[i] < pokesNum:
		pokesNum = temp[i]
print(pokesNum)


letters = list(input())
counts = [letters.count(l) for l in 'Bulbasr']
counts[1] //= 2
counts[4] //= 2
print(min(counts))


from collections import defaultdict
(MyLetters, MyDict) = ('Bulbasr', defaultdict(int))
for i in MyLetters:
	MyDict[i] = 0
for i in input():
	MyDict[i] += 1
print(min([MyDict['B'], MyDict['u'] // 2, MyDict['l'], MyDict['b'], MyDict['a'] // 2, MyDict['r'], MyDict['s']]))


s = input()
count = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 's': 0, 'a': 0, 'r': 0}
for i in range(len(s)):
	if s[i] in count:
		count[s[i]] += 1
count['a'] = int(count['a'] / 2)
count['u'] = int(count['u'] / 2)
myList = count.values()
print(min(myList))


d = {}
for i in input().strip():
	d[i] = d.get(i, 0) + 1
ans = min(d.get('B', 0), d.get('u', 0) // 2, d.get('l', 0), d.get('b', 0), d.get('a', 0) // 2, d.get('s', 0), d.get('r', 0))
print(ans)


w = 'Bulbasaur'
d = {}
for i in w:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
s = input()
ans = 10 ** 5 + 1
chk = {}
for i in s:
	if i in chk:
		chk[i] += 1
	else:
		chk[i] = 1
for i in d:
	if i in chk:
		ans = min(ans, chk[i] // d[i])
	else:
		ans = 0
print(ans)


s = input()
lst = []
B = s.count('B')
lst.append(B)
u = s.count('u')
l = s.count('l')
lst.append(l)
b = s.count('b')
lst.append(b)
a = s.count('a')
ss = s.count('s')
lst.append(ss)
r = s.count('r')
lst.append(r)
a = a // 2
lst.append(a)
u = u // 2
lst.append(u)
print(min(lst))


S = input()
(B, u, l) = (S.count('B'), S.count('u'), S.count('l'))
(b, a, s, r) = (S.count('b'), S.count('a'), S.count('s'), S.count('r'))
T = 0
while B >= 1 and u >= 2 and (l >= 1) and (b >= 1) and (a >= 2) and (s >= 1) and (r >= 1):
	B -= 1
	u -= 2
	l -= 1
	b -= 1
	a -= 2
	s -= 1
	r -= 1
	T += 1
print(T)


t = input()
one = 'Blbsr'
two = 'au'
m = min(min((t.count(c) for c in one)), min((t.count(c) // 2 for c in two)))
print(m)


letters = input()
counter = [0, 0, 0, 0, 0, 0, 0]
for c in letters:
	if c == 'B':
		counter[0] += 1
	elif c == 'u':
		counter[1] += 1
	elif c == 'l':
		counter[2] += 1
	elif c == 'b':
		counter[3] += 1
	elif c == 'a':
		counter[4] += 1
	elif c == 's':
		counter[5] += 1
	elif c == 'r':
		counter[6] += 1
counter[1] //= 2
counter[4] //= 2
print(min(counter))


from collections import Counter
source = Counter(input())
print(min((source[letter] // count for (letter, count) in Counter('Bulbasaur').items())))


ss = str(input(''))
import math
Bb = 0
u = 0
l = 0
b = 0
a = 0
s = 0
r = 0
for i in range(len(ss)):
	if ss[i] == 'B':
		Bb += 1
	elif ss[i] == 'u':
		u += 1
	elif ss[i] == 'l':
		l += 1
	elif ss[i] == 'b':
		b += 1
	elif ss[i] == 'a':
		a += 1
	elif ss[i] == 's':
		s += 1
	elif ss[i] == 'r':
		r += 1
u = math.trunc(u / 2)
a = math.trunc(a / 2)
f = [Bb, u, l, b, a, s, r]
print(min(f))


s = input()
a = []
q = s.count('B')
w = s.count('u')
e = s.count('l')
r = s.count('b')
t = s.count('a')
y = s.count('s')
u = s.count('r')
if q >= 1 and w >= 2 and (e >= 1) and (r >= 1) and (t >= 2) and (y >= 1) and (u >= 1):
	w = w // 2
	t = t // 2
	a.append(q)
	a.append(w)
	a.append(e)
	a.append(r)
	a.append(t)
	a.append(y)
	a.append(u)
	print(min(a))
else:
	print(0)


string = input()
count_B = string.count('B')
count_u = string.count('u')
count_l = string.count('l')
count_b = string.count('b')
count_a = string.count('a')
count_s = string.count('s')
count_r = string.count('r')
print(min(count_B, int(count_u / 2), count_l, count_b, int(count_a / 2), count_s, count_u, count_r))


from collections import Counter
s = input()
a = Counter(s)
a['a'] //= 2
a['u'] //= 2
bul = 'Bulbasaur'
ans = 100000
for i in bul:
	ans = min(ans, a[i])
print(ans)


st = input()
B = 0
l = 0
b = 0
a = 0
u = 0
s = 0
r = 0
for c in st:
	if c == 'B':
		B += 1
	elif c == 'l':
		l += 1
	elif c == 'b':
		b += 1
	elif c == 'a':
		a += 1
	elif c == 'u':
		u += 1
	elif c == 's':
		s += 1
	elif c == 'r':
		r += 1
print(min([B, l, b, a // 2, u // 2, s, r]))


s = input()
d = []
d.append(s.count('B'))
d.append(int(s.count('u') / 2))
d.append(s.count('l'))
d.append(s.count('b'))
d.append(int(s.count('a') / 2))
d.append(s.count('s'))
d.append(s.count('r'))
print(min(d))


n = input()
a = ['B', 'u', 'l', 'b', 'a', 's', 'r']
b = 7 * [0]
c = [1, 2, 1, 1, 2, 1, 1]
d = 7 * [0]
for i in range(7):
	b[i] = n.count(a[i])
for i in range(7):
	d[i] = b[i] // c[i]
print(min(d))


from collections import Counter
(b, s) = (Counter('Bulbasaur'), Counter(input()))
print(min((s[ch] // b[ch] for ch in b)))


s = input()
Pok = 'Bulbasr'
Word = [0] * 7
for i in range(len(s)):
	if s[i] in Pok:
		ind = Pok.index(s[i])
		Word[ind] += 1
m1 = min(Word[2:4])
m2 = min(Word[5:7])
m3 = min(m1, m2, Word[0])
if Word[4] >= m3 * 2 and Word[1] >= m3 * 2:
	print(m3)
elif Word[1] == Word[4] == m3:
	print(Word[1] // 2)
else:
	pol1 = Word[1] // 2
	pol2 = Word[4] // 2
	pol = min(pol1, pol2)
	if pol <= m3:
		print(pol)
	else:
		print(0)


x = input()
res = min(x.count('B'), x.count('b'), x.count('s'), x.count('r'), x.count('l'), x.count('a') / 2, x.count('u') / 2)
print(int(res))


s = input()
a = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
for c in s:
	if c == 'B':
		a[c] += 1
	elif c == 'u':
		a[c] += 1
	elif c == 'l':
		a[c] += 1
	elif c == 'b':
		a[c] += 1
	elif c == 'a':
		a[c] += 1
	elif c == 's':
		a[c] += 1
	elif c == 'r':
		a[c] += 1
k = 0
while True:
	a['B'] -= 1
	a['u'] -= 2
	a['l'] -= 1
	a['b'] -= 1
	a['a'] -= 2
	a['s'] -= 1
	a['r'] -= 1
	if a['B'] < 0:
		break
	if a['u'] < 0:
		break
	if a['l'] < 0:
		break
	if a['b'] < 0:
		break
	if a['a'] < 0:
		break
	if a['s'] < 0:
		break
	if a['r'] < 0:
		break
	k += 1
print(k)


f = {}
for x in input():
	try:
		f[x] += 1
	except:
		f[x] = 1
try:
	print(min(f['B'], f['u'] // 2, f['l'], f['b'], f['a'] // 2, f['s'], f['r']))
except:
	print(0)


s = 'Bulbasaur'
lst = input().strip()
cnt1 = [0] * 26
cnt2 = [0] * 26
for i in range(len(lst)):
	if lst[i] >= 'a' and lst[i] <= 'z':
		cnt1[ord(lst[i]) - ord('a')] += 1
	else:
		cnt2[ord(lst[i]) - ord('A')] += 1
answer = 1000000.0
for i in range(1, len(s)):
	answer = min(answer, cnt1[ord(s[i]) - ord('a')])
answer = min(answer, cnt1[0] // 2, cnt1[ord('u') - 97] // 2)
print(min(answer, cnt2[1]))


from collections import Counter
b = 'Bulbasaur'
a = Counter(b)
s = Counter(input())
x = []
for i in set(b):
	x.append(s[i] // a[i])
print(min(x))


import sys
s = list(sys.stdin.readline())
sol = 0
c = [s.count('B'), s.count('u'), s.count('l'), s.count('b'), s.count('a'), s.count('s'), s.count('r')]
c[1] //= 2
c[4] //= 2
sys.stdout.write(str(min(c)) + '\n')


s = input()
x1 = s.count('B')
x2 = s.count('b')
x3 = s.count('a')
x4 = s.count('u')
x5 = s.count('l')
x6 = s.count('s')
x7 = s.count('r')
x3 //= 2
x4 //= 2
print(min(x1, x2, x3, x4, x5, x6, x7))


import collections
s = input()
cs = collections.Counter(s)
cs1 = collections.Counter('Bulbasaur')
ans = len(s)
for (k, v) in cs1.items():
	ans = min(ans, cs[k] // v)
print(ans)


string = input()
a = list((string.count('B'), string.count('u') // 2, string.count('l'), string.count('b'), string.count('a') // 2, string.count('s'), string.count('r')))
print(min(a))


s = input()
bb = 0
u = 0
l = 0
b = 0
a = 0
ss = 0
r = 0
for i in s:
	if i == 'B':
		bb += 1
	elif i == 'u':
		u += 1
	elif i == 'l':
		l += 1
	elif i == 'b':
		b += 1
	elif i == 'a':
		a += 1
	elif i == 's':
		ss += 1
	elif i == 'r':
		r += 1
u = u // 2
a = a // 2
mi1 = min(bb, u)
mi2 = min(l, b)
mi1 = min(mi1, mi2)
mi3 = min(a, ss)
mi2 = min(mi2, mi3)
mi3 = min(mi1, mi2)
ans = min(mi3, r)
print(ans)


a = input()
cB = 0
cu = 0
cl = 0
cb = 0
ca = 0
cr = 0
cs = 0
for i in range(len(a)):
	if a[i] == 'B':
		cB += 1
	elif a[i] == 'u':
		cu += 1
	elif a[i] == 'l':
		cl += 1
	elif a[i] == 'b':
		cb += 1
	elif a[i] == 's':
		cs += 1
	elif a[i] == 'r':
		cr += 1
	elif a[i] == 'a':
		ca += 1
print(min(cB, cu // 2, cl, cb, ca // 2, cs, cr))


letters = set('Bulbasaur')
string = input()
counts = []
for i in letters:
	if i in ['a', 'u']:
		counts.append(string.count(i) // 2)
	else:
		counts.append(string.count(i))
print(min(counts))


s = str(input())
m = []
m.append(s.count('B'))
m.append(s.count('a') / 2)
m.append(s.count('l'))
m.append(s.count('b'))
m.append(s.count('s'))
m.append(s.count('u') / 2)
m.append(s.count('r'))
print(int(min(m)))


def main():
	QWE = 'river'
	INF = 10 ** 18 + 9
	EPS = 10 ** (-10)
	import sys, math, re
	s = input()
	t = 'Bulbasaur'
	q = 0
	ans = INF
	d = {'B': 0, 'b': 0, 'u': 0, 'l': 0, 'a': 0, 's': 0, 'r': 0}
	e = {'B': 1, 'b': 1, 'u': 2, 'l': 1, 'a': 2, 's': 1, 'r': 1}
	for i in s:
		try:
			d[i] += 1
		except KeyError:
			pass
	for i in d:
		ans = min(ans, d[i] // e[i])
	print(ans)
main()


goal = 'Bulbasaur'
data = input()
count = len(data)
for char in goal:
	if char == 'a' or char == 'u':
		if data.count(char) // 2 < count:
			count = data.count(char) // 2
	elif data.count(char) < count:
		count = data.count(char)
print(count)


s = input()
a = 'Bulbasaur'
counter = dict()
for i in s:
	if i not in counter:
		counter[i] = 0
	counter[i] += 1
for i in a:
	if i not in counter:
		print(0)
		exit()
print(min(counter['B'], counter['u'] // 2, counter['l'], counter['b'], counter['a'] // 2, counter['s'], counter['r']))


s = input()
d = {}
for c in 'Bulbasaur':
	d[c] = 0
for c in s:
	if c in d:
		d[c] += 1
ans = float('inf')
for c in d:
	if c == 'a' or c == 'u':
		ans = min(ans, d[c] // 2)
	else:
		ans = min(ans, d[c])
print(ans)


from collections import Counter
s = input()
x = Counter(s)
c = 0
if 'B' in x and 'a' in x and ('u' in x) and ('l' in x) and ('b' in x) and ('s' in x) and ('r' in x):
	c += min(x['B'], x['a'] // 2, x['u'] // 2, x['l'], x['b'], x['s'], x['r'])
print(c)


input = input()
input = list(input)
dictBulb = {'B': 1, 'u': 2, 'b': 1, 'l': 1, 'a': 2, 's': 1, 'r': 1}
dict = {}
setb = set('Bulbasaur')
for letter in list(setb):
	dict[letter] = 0
for letter in input:
	if letter in setb:
		dict[letter] += 1
dict['u'] = dict['u'] // 2
dict['a'] = dict['a'] // 2
print(min(dict.values()))


from collections import *
s = input()
c = Counter(s)
print(min(c['B'], c['a'] // 2, c['u'] // 2, c['b'], c['l'], c['s'], c['r']))


s = str(input())
bul = 'Bulbasaur'
mini = 1000000
for i in bul:
	k = 0
	for g in s:
		if ord(i) == ord(g):
			k += 1
	if i == 'u' or i == 'a':
		k = k // 2
	if k < mini:
		mini = k
print(mini)


s = input()
t = 'Bulbasaur'
num = min((s.count(i) // t.count(i) for i in t))
print(num)


s = input()
z = 'Bulbasaur'
c = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in range(len(z)):
	for j in range(len(s)):
		if z[i] in s[j]:
			c[i] += 1
c[1] //= 2
c[4] //= 2
c[6] //= 2
c[7] //= 2
c.sort()
print(c[0])


string = str(input())
B = 0
u = 0
l1 = 0
b = 0
a = 0
s = 0
r = 0
for i in string:
	if i == 'B':
		B += 1
	elif i == 'u':
		u += 1
	elif i == 'l':
		l1 += 1
	elif i == 'b':
		b += 1
	elif i == 'a':
		a += 1
	elif i == 's':
		s += 1
	elif i == 'r':
		r += 1
a /= 2
a = int(a)
u /= 2
u = int(u)
ara = [B, a, l1, b, s, u, r]
ara.sort()
print(ara[0])


s = input()
B = s.count('B')
u = s.count('u')
l = s.count('l')
b = s.count('b')
a = s.count('a')
ss = s.count('s')
r = s.count('r')
res = min(B, u // 2, a // 2, l, b, ss, r)
print(res)


chrs = {'u': 0, 'B': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}

def func(ch):
	if ch in chrs.keys():
		chrs[ch] += 1
str = input()
for i in list(str):
	func(i)
chrs['u'] /= 2
chrs['a'] /= 2
print(int(min(chrs.values())))


s = input()
B = s.count('B')
u = s.count('u')
l = s.count('l')
b = s.count('b')
a = s.count('a')
sx = s.count('s')
r = s.count('r')
answer = min([B, u // 2, l, b, a // 2, sx, r])
print(answer)


x = input()
B = 0
u = 0
l = 0
b = 0
a = 0
s = 0
r = 0
for i in x:
	if i == 'B':
		B += 1
	elif i == 'u':
		u += 1
	elif i == 'l':
		l += 1
	elif i == 'b':
		b += 1
	elif i == 'a':
		a += 1
	elif i == 's':
		s += 1
	elif i == 'r':
		r += 1
pokemons = 0
while B >= 1 and u >= 2 and (l >= 1) and (b >= 1) and (a >= 2) and (s >= 1) and (r >= 1):
	pokemons += 1
	B -= 1
	u -= 2
	l -= 1
	b -= 1
	a -= 2
	s -= 1
	r -= 1
print(pokemons)


s = str(input())
arr = [0 for i in range(7)]
m = 'Bulbasr'
for i in s:
	if i in m:
		arr[m.index(i)] += 1
arr[1] = arr[1] // 2
arr[4] = arr[4] // 2
print(min(arr))


word = list(input())
my = 'Bulbasaur'
counterB = 0
counteru = 0
counterl = 0
countera = 0
counters = 0
counterr = 0
counterb = 0
if len(word) < len(my):
	print(0)
else:
	for i in word:
		if i == 'B':
			counterB += 1
		elif i == 'u':
			counteru += 1
		elif i == 'l':
			counterl += 1
		elif i == 'a':
			countera += 1
		elif i == 's':
			counters += 1
		elif i == 'r':
			counterr += 1
		elif i == 'b':
			counterb += 1
	counteru //= 2
	countera //= 2
	print(min(counterB, counteru, counterl, countera, counters, counterr, counterb))


q = [str(x) for x in input()]
capB = q.count('B')
b = q.count('b')
u = q.count('u')
l = q.count('l')
a = q.count('a')
s = q.count('s')
r = q.count('r')
print(min(capB, b, u // 2, l, s, a // 2, r))


x = input()
y = set(list('Bulbasaur'))
Y = {i: 0 for i in y}
for i in x:
	if i in y:
		Y[i] += 1
Y['a'] = Y['a'] // 2
Y['u'] = Y['u'] // 2
J = min(Y.values())
print(J)


s = input()
c1 = s.count('B')
c2 = s.count('u')
c3 = s.count('l')
c4 = s.count('b')
c5 = s.count('a')
c6 = s.count('s')
c7 = s.count('r')
print(min(c1, c2 // 2, c3, c4, c5 // 2, c6, c7))


string = input()
line = []
for i in range(7):
	line += [0]
for i in range(len(string)):
	if string[i] == 'B':
		line[0] += 1
	if string[i] == 'u':
		line[1] += 0.5
	if string[i] == 'l':
		line[2] += 1
	if string[i] == 'b':
		line[3] += 1
	if string[i] == 'a':
		line[4] += 0.5
	if string[i] == 's':
		line[5] += 1
	if string[i] == 'r':
		line[6] += 1
print(int(min(line)))


a = list(input())
m1 = a.count('B')
m2 = a.count('u') // 2
m3 = a.count('l')
m4 = a.count('b')
m5 = a.count('a') // 2
m6 = a.count('s')
m7 = a.count('r')
print(min(m1, m2, m3, m4, m5, m6, m7))


s = input()
one = 'Bulbasr'
count = {c: 0 for c in one}
twice = 'a'
answer = len(s)
for c in s:
	if c in count:
		count[c] += 1
count['a'] //= 2
count['u'] //= 2
print(min(count.values()))


(s, pattern) = (input(), 'Bulbasaur')
print(min((s.count(ch) // pattern.count(ch) for ch in set(pattern))))


string = input()
check = 'Bulbasaur'
res = 1000000000000000
for x in check:
	res = min(res, string.count(x) // check.count(x))
print(res)


s = input()
nm = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'a': 0, 'u': 0, 'r': 0}
for i in s:
	if i in nm:
		nm[i] += 1
nm['u'] //= 2
nm['a'] //= 2
print(min(nm.values()))


a = input()
a1 = ''
bu = 'Bulbasaur'
bul = [i for i in 'B u l b a s a u r'.split()]
ok = 0
c = []
for i in bul:
	c.append(a.count(i) // bu.count(i))
ans = min(c)
print(ans)


b = {'B': 1, 'u': 2, 'l': 1, 'b': 1, 'a': 2, 's': 1, 'r': 1}
n = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
s = input()
for i in s:
	if i in n:
		n[i] += 1
for i in list(b.keys()):
	n[i] = int(n[i] / b[i])
print(sorted(list(n.values()))[0])


from collections import Counter
BULBAZAUR = Counter('Bulbasaur')
letter_counts = Counter(input())
if any((x not in letter_counts for x in BULBAZAUR)):
	print(0)
	exit(0)
matches = 99999999999
for x in BULBAZAUR:
	in_word = BULBAZAUR[x]
	in_news = letter_counts[x]
	matches = min(matches, in_news // in_word)
print(matches)


s = input()
word = 'Bulbasaur'
lst = []
for i in word:
	lst.append(s.count(i) // word.count(i))
print(min(lst))


s = input()
cnt = [s.count(i) for i in 'aulbsrB']
cnt[0] //= 2
cnt[1] //= 2
print(min(cnt))


s = input()
pokemon = 'Bulbasaur'
number = []
for i in pokemon:
	count = 0
	for j in s:
		if i == j:
			count += 1
	if i == 'a' or i == 'u':
		count = int(count / 2)
	number.append(count)
print(min(number))


s = input()
d = {}
for c in s:
	d[c] = d.get(c, 0) + 1
B = d.get('B', 0)
u = d.get('u', 0) // 2
l = d.get('l', 0)
b = d.get('b', 0)
a = d.get('a', 0) // 2
s = d.get('s', 0)
r = d.get('r', 0)
print(min(B, u, l, b, a, s, r))


w = 'Bulbasaur'
s = input()
ans = 10 ** 5 + 1
chk = {}
for i in s:
	if i in chk:
		chk[i] += 1
	else:
		chk[i] = 1
for i in w:
	if i in chk:
		ans = min(ans, chk[i] // [1, 2][i == 'a' or i == 'u'])
	else:
		ans = 0
print(ans)


ss = input()
B = 0
u = 0
l = 0
b = 0
a = 0
s = 0
r = 0
for i in ss:
	if i == 'B':
		B = B + 1
	elif i == 'u':
		u = u + 1
	elif i == 'l':
		l = l + 1
	elif i == 'b':
		b = b + 1
	elif i == 'a':
		a = a + 1
	elif i == 's':
		s = s + 1
	elif i == 'r':
		r = r + 1
u = int(u / 2)
a = int(a / 2)
Sum = min([B, u, l, b, a, s, r])
print(Sum)


def main():
	input_paper = input()
	input_list = list(input_paper)
	count_B = input_list.count('B')
	count_u = input_list.count('u') / 2
	count_l = input_list.count('l')
	count_b = input_list.count('b')
	count_a = input_list.count('a') / 2
	count_s = input_list.count('s')
	count_r = input_list.count('r')
	print(int(min(count_B, count_u, count_l, count_b, count_a, count_s, count_r)))
main()


st = input()
Bcount = 0
ucount = 0
lcount = 0
bcount = 0
acount = 0
scount = 0
rcount = 0
for ch in st:
	if ch == 'B':
		Bcount += 1
	elif ch == 'u':
		ucount += 1
	elif ch == 'l':
		lcount += 1
	elif ch == 'b':
		bcount += 1
	elif ch == 'a':
		acount += 1
	elif ch == 's':
		scount += 1
	elif ch == 'r':
		rcount += 1
print(min(Bcount, ucount // 2, lcount, bcount, acount // 2, scount, rcount))


s = input().strip()
a = [0] * 255
for c in s:
	a[ord(c)] += 1
print(min(a[ord('B')], a[ord('u')] // 2, a[ord('l')], a[ord('b')], a[ord('a')] // 2, a[ord('s')], a[ord('r')]))


n = input()
s = 'Bulbasr'
d = [0 for i in range(7)]
c = 10 ** 5 + 5
for i in range(7):
	d[i] = n.count(s[i])
d[1] //= 2
d[4] //= 2
for i in d:
	c = min(i, c)
print(c)


d = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'a': 0, 'u': 0, 'r': 0}
for x in input():
	if x in d:
		d[x] += 1
d['a'] //= 2
d['u'] //= 2
print(min(d.values()))


a = input()
c1 = a.count('B')
c2 = a.count('b')
c3 = a.count('u')
c4 = a.count('l')
c5 = a.count('a')
c6 = a.count('s')
c7 = a.count('r')
if c1 and c2 and (c3 > 1) and c4 and (c5 > 1) and c6 and c7:
	x = min(c1, c2, c4, c6, c7)
	y = min(x, c3 // 2, c5 // 2)
	print(y)
else:
	print('0')


s = input()
d = {}
for c in 'Bulbasr':
	d[c] = 0
for c in s:
	if c in 'Bulbasaur':
		d[c] += 1
d['a'] //= 2
d['u'] //= 2
ans = 100000
for (a, b) in d.items():
	ans = min(b, ans)
print(ans)


letters = {c: 0 for c in 'Bulbasaur'}
etalon = letters.copy()
for c in 'Bulbasaur':
	etalon[c] += 1
for c in input():
	if c in letters:
		letters[c] += 1
print(min((letters[c] // etalon[c] for c in etalon)))


import os
from collections import defaultdict
LOCAL_PC = 'n1amr' in os.path.expanduser('~')

def solve(input, print):
	s = input()
	d = defaultdict(int)
	for c in s:
		d[c] += 1
	print(min(d['B'], d['u'], d['l'], d['b'], d['a'] // 2, d['u'] // 2, d['r'], d['s']))

def process_file(in_name, out_name):
	with open(in_name, 'r') as fin:
		with open(out_name, 'w') as fout:

			def read():
				return fin.readline().rstrip('\n')

			def write(*args, end='\n'):
				text = ' '.join(map(str, args)) + end
				fout.write(text)
				print(text, end='')
			t = int(fin.readline())
			for i in range(t):
				read()
				write('Case #{T}: \n'.format(T=i + 1), end='')
				solve(read, write)
				write()

def process_stdio():

	def read():
		return input()

	def write(*args, end='\n'):
		print(*args, end=end)
	solve(read, write)
if LOCAL_PC:
	in_name = __file__[:-3] + '.in'
	out_name = __file__[:-3] + '.out'
	process_file(in_name, out_name)
else:
	process_stdio()


a = input()
s = 'Bulbasaur'
c = list(map(a.count, s))
c[1] //= 2
c[-3] //= 2
print(min(c))


s = input()
ans = min(min((s.count(x) for x in 'Blrsb')), s.count('a') // 2, s.count('u') // 2)
print(ans)


import math
S = str(input())
ans = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
for i in S:
	if i in ans.keys():
		ans[i] += 1
ansVal = 9999999
for (key, val) in ans.items():
	if key == 'a' or key == 'u':
		ansVal = min(ansVal, val // 2)
	else:
		ansVal = min(ansVal, val)
print(ansVal)


def getFreq(s):
	cnt = [0] * 256
	for x in s:
		cnt[ord(x)] += 1
	return cnt

def main():
	s = input()
	cnt1 = getFreq(s)
	s = 'Bulbasaur'
	cnt2 = getFreq(s)
	ans = 1000000
	for (i, x) in enumerate(cnt2):
		if x == 0:
			continue
		ans = min(ans, cnt1[i] // x)
	print(ans)
main()


s = input()
count = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
for c in s:
	if c in count:
		count[c] += 1
count['u'] /= 2
count['a'] /= 2
print(int(min(count.values())))


from sys import stdin
import collections

def f(s):
	ct = collections.Counter()
	for ss in s:
		if ss in 'Bulbasaur':
			ct[ss] += 1
	ct['u'] //= 2
	ct['a'] //= 2
	if len(ct) != 7:
		return 0
	return min(ct.values())
s = stdin.readline()
print(f(s))


import sys
input = sys.stdin.readline
paper = input()
B = paper.count('B')
u = paper.count('u') // 2
l = paper.count('l')
b = paper.count('b')
a = paper.count('a') // 2
s = paper.count('s')
r = paper.count('r')
print(min(B, u, l, b, a, s, r))


from collections import Counter
inpstr = input().strip()
counter = Counter()
result = 100000
for x in inpstr:
	if x in list('Bulbasr'):
		counter[x] += 1
result = min(result, counter['B'])
result = min(result, counter['u'] // 2)
result = min(result, counter['b'])
result = min(result, counter['a'] // 2)
result = min(result, counter['l'])
result = min(result, counter['s'])
result = min(result, counter['r'])
print(result)


from collections import Counter
k = Counter('Bulbasaur')
r = Counter(input())
print(min((r[c] // k[c] for c in k)))


bulbasaur = dict(B=1, u=2, l=1, b=1, a=2, s=1, r=1)
text = input()
letters = dict()
for c in text:
	letters[c] = letters.get(c, 0) + 1
count = 0
while True:
	for key in bulbasaur.keys():
		letters[key] = letters.get(key, 0) - bulbasaur[key]
		if letters[key] < 0:
			print(count)
			exit(0)
	count += 1


pala = input()
B = b = u = l = a = s = r = 0
B = pala.count('B')
b = pala.count('b')
u = pala.count('u')
l = pala.count('l')
a = pala.count('a')
s = pala.count('s')
r = pala.count('r')
a = a // 2
u = u // 2
menor = min([B, b, u, l, a, s, r])
if menor == 0:
	print(0)
else:
	print(menor)


texto = input()
s = len(texto)
contador = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'a': 0, 'u': 0, 'r': 0}
for i in range(s):
	letra = texto[i]
	if letra in contador:
		contador[letra] += 1
minimo = contador['B']
for letra in contador:
	if contador[letra] < minimo:
		minimo = contador[letra]
cantidad_a = contador['a']
cantidad_u = contador['u']
if cantidad_a / 2 >= minimo and cantidad_u / 2 >= minimo:
	print(minimo)
elif cantidad_a < cantidad_u:
	print(cantidad_a // 2)
else:
	print(cantidad_u // 2)


import sys
input = sys.stdin.readline
frontpage = input().strip()
bulbs = 0
letters = [0, 0, 0, 0, 0, 0, 0, 0, 0]
iletters = ['B', 'u', 'l', 'b', 'a', 's', 'a', 'u', 'r']
for i in frontpage:
	if i in 'Bulbasaur':
		if i == 'a':
			if letters[4] > letters[6]:
				letters[6] += 1
			else:
				letters[4] += 1
		elif i == 'u':
			if letters[1] > letters[7]:
				letters[7] += 1
			else:
				letters[1] += 1
		else:
			letters[iletters.index(i)] += 1
print(min(letters))


from sys import *
from decimal import *

def gcd(a, b):
	if b:
		return gcd(b, a % b)
	return a
kek = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
ans = 0
txt = input()
for i in txt:
	if kek.get(i, -1) != -1:
		kek[i] += 1
ans = kek['B']
for i in 'Bulbasaur':
	lol = kek[i]
	if i in 'ua':
		lol //= 2
	ans = min(ans, lol)
print(ans)


S = input()
comp = 'Bulbasaur'
nB = S.count('B')
nu = S.count('u')
nl = S.count('l')
nb = S.count('b')
na = S.count('a')
ns = S.count('s')
nr = S.count('r')
ans = min(nB, nu // 2, nl, nb, na // 2, ns, nr)
print(ans)


def program():
	s = input()
	word = 'Bulbasaur'
	dct = {}
	kecil = ''
	if len(s) < 9:
		print('0')
		return 0
	for char in word:
		dct[char] = s.count(char)
	d2 = {'a': dct['a'] // 2, 'u': dct['u'] // 2}
	dct.update(d2)
	minimum = min(dct.items(), key=lambda x: x[1])
	print(minimum[1])
	return 0
program()


def main():
	s = input()
	print(solver(s))

def solver(s):
	d = {c: None for c in ['B', 'u', 'l', 'b', 'a', 's', 'r']}
	for letter in d:
		d[letter] = s.count(letter)
	for repeat in ['a', 'u']:
		d[repeat] = d[repeat] // 2
	return min([d[letter] for letter in d])
main()


S = input()
b = 'Blbsur'
pos = 0
ret = 1000000
for s in b:
	ret = min(ret, S.count(s))
print(min(ret, S.count('a') // 2, S.count('u') // 2))


s = input()
b1 = s.count('B')
u = s.count('u')
l = s.count('l')
b = s.count('b')
a = s.count('a')
s1 = s.count('s')
u = s.count('u')
r = s.count('r')
a = a // 2
u = u // 2
print(min(b1, u, b, l, a, s1, u, r))


from collections import Counter
s = input()
m = Counter(s)
(result, target) = (6666666, Counter('Bulbasaur'))
for ch in target.keys():
	result = min(result, m[ch] // target[ch])
print(result)


import sys
text = sys.stdin.readline().rstrip()
counts = {'B': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'u': 0, 'r': 0}
for ch in text:
	if ch in counts:
		counts[ch] += 1
maxbulb = float('inf')
for (k, v) in counts.items():
	if k == 'a' or k == 'u':
		maxbulb = min(maxbulb, v // 2)
	else:
		maxbulb = min(maxbulb, v)
print(maxbulb)


from collections import defaultdict

def main():
	word = {'B', 'u', 'l', 'b', 'a', 's', 'r'}
	answer = defaultdict(int)
	s = input()
	for i in s:
		if i in word:
			answer[i] += 1
	if len(answer.keys()) != len(word):
		print(0)
	else:
		answer['a'] = int(answer['a'] / 2)
		answer['u'] = int(answer['u'] / 2)
		word_count = min(answer.values())
		print(word_count)
main()


s = input()
quest = {'B': 1, 'u': 2, 'l': 1, 'b': 1, 'a': 2, 's': 1, 'r': 1}
d = {x: 0 for x in quest.keys()}
for ch in s:
	if ch in quest:
		d[ch] += 1 if quest[ch] != 2 else 0.5
print(int(min(d.values())))


s = input()
b1 = b2 = b3 = b4 = b5 = b6 = b7 = 0
for i in range(len(s)):
	if s[i] == 'B' or s[i] == 'u' or s[i] == 'l' or (s[i] == 'b') or (s[i] == 'a') or (s[i] == 's') or (s[i] == 'r'):
		if s[i] == 'B':
			b1 += 1
		elif s[i] == 'u':
			b2 += 1
		elif s[i] == 'l':
			b3 += 1
		elif s[i] == 'b':
			b4 += 1
		elif s[i] == 'a':
			b5 += 1
		elif s[i] == 's':
			b6 += 1
		elif s[i] == 'r':
			b7 += 1
print(min(b1, int(b2 / 2), b3, b4, int(b5 / 2), b6, b7))


def bulbasaur():
	n = input()
	dic = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
	for i in n:
		if i in dic.keys():
			dic[i] += 1
	dic['a'] = dic['a'] // 2
	dic['u'] = dic['u'] // 2
	mini = dic['B']
	for k in dic:
		if dic[k] < mini:
			mini = dic[k]
	print(mini)
bulbasaur()


from collections import Counter
count = 0
page = Counter(input())
bulb = Counter('Bulbasaur')
while True:
	page.subtract(bulb)
	if all([x >= 0 for x in dict(page).values()]):
		count += 1
	else:
		break
print(count)


pokemon = set(['B', 'u', 'l', 'b', 's', 'a', 'r'])
A = dict(zip(['B', 'u', 'l', 'b', 's', 'a', 'r'], [0, 0, 0, 0, 0, 0, 0]))
string = input()
res = 0
for i in string:
	if i in pokemon:
		A[i] += 1
key = 'B'
while A[key] > 0:
	for key in A:
		if A[key] <= 0:
			break
	else:
		for key in A:
			if key == 'u' or key == 'a':
				if A[key] - 2 < 0:
					A[key] -= 2
					break
				else:
					A[key] -= 2
			else:
				A[key] -= 1
		if A[key] >= 0:
			res += 1
print(res)


p = 'Bulbasr'
s = input()
ans = 100000
for c in p:
	k = s.count(c)
	if c == 'a' or c == 'u':
		k //= 2
	ans = min(ans, k)
print(ans)


R = lambda : list(map(int, input().split(' ')))
s = input()
B = [0 for i in 'Bulbasr']
for i in s:
	if i == 'B':
		B[1] += 1
	if i == 'u':
		B[2] += 1
	if i == 'l':
		B[3] += 1
	if i == 'b':
		B[4] += 1
	if i == 'a':
		B[0] += 1
	if i == 's':
		B[5] += 1
	if i == 'r':
		B[6] += 1
B[0] = int(B[0] / 2)
B[2] = int(B[2] / 2)
print(min(B))


s = str(input())
s = sorted(s)
c = 0
done = False
let = ['B', 'u', 'l', 'b', 'a', 's', 'a', 'u', 'r']
l = ['B', 'u', 'l', 'b', 'a', 's', 'r']
n = [0.0] * 7
for i in range(len(s)):
	cur = s[i]
	if cur == 'B':
		n[0] += 1
	elif cur == 'u':
		n[1] += 1
	elif cur == 'l':
		n[2] += 1
	elif cur == 'b':
		n[3] += 1
	elif cur == 'a':
		n[4] += 1
	elif cur == 's':
		n[5] += 1
	elif cur == 'r':
		n[6] += 1
d = {'B': n[0], 'u': n[1], 'l': n[2], 'b': n[3], 'a': n[4], 's': n[5], 'r': n[6]}
i = 0
while not done:
	a = let[i]
	nc = d.get(let[i])
	if nc > 0:
		u = {a: nc - 1}
		d.update(u)
		if i == 8:
			c += 1
			i = 0
		else:
			i += 1
	else:
		done = True
print(c)


s = input()
a1 = s.count('B')
a2 = s.count('u')
a2 //= 2
a3 = s.count('l')
a4 = s.count('b')
a5 = s.count('a')
a5 //= 2
a6 = s.count('s')
a8 = s.count('r')
print(min(a1, a2, a3, a4, a5, a6, a8))


import math
s = input()
sv = []
sum = 0
B = 0
u = 0
l = 0
b = 0
a = 0
ss = 0
r = 0
i = 0
while i < len(s):
	if s[i] == 'B':
		B += 1
	if s[i] == 'u':
		u += 1
	if s[i] == 'l':
		l += 1
	if s[i] == 'b':
		b += 1
	if s[i] == 'a':
		a += 1
	if s[i] == 's':
		ss += 1
	if s[i] == 'r':
		r += 1
	i += 1
sum = B
if u / 2 < sum:
	sum = math.floor(u / 2)
if l < sum:
	sum = l
if b < sum:
	sum = b
if a / 2 < sum:
	sum = math.floor(a / 2)
if ss < sum:
	sum = ss
if r < sum:
	sum = r
print(sum)


s = input()
tB = s.count('B')
tu = s.count('u')
tl = s.count('l')
tb = s.count('b')
ta = s.count('a')
ts = s.count('s')
tr = s.count('r')
t = tB
if tu / 2 < t:
	t = int(tu / 2)
if tl < t:
	t = tl
if tb < t:
	t = tb
if ta / 2 < t:
	t = int(ta / 2)
if ts < t:
	t = ts
if tr < t:
	t = tr
print(t)


str_data = input()
d = dict()
d['B'] = 0
d['u'] = 0
d['l'] = 0
d['b'] = 0
d['a'] = 0
d['s'] = 0
d['r'] = 0
for c in str_data:
	if c in d:
		d[c] = d[c] + 1
d['u'] = d['u'] // 2
d['a'] = d['a'] // 2
print(min(d.values()))


import collections
text = str(input())
Detail = collections.Counter(text)
Detail['u'] = int(Detail['u'] / 2)
Detail['a'] = int(Detail['a'] / 2)
print(min(Detail['B'], Detail['u'], Detail['l'], Detail['b'], Detail['a'], Detail['s'], Detail['r']))


s = input()
x = []
i = 0
for i in 'Blbrs':
	x.append(s.count(i))
for i in 'ua':
	x.append(s.count(i) // 2)
print(min(x))


string = input()
n = 0
values = []
for x in 'Bulbasr':
	a = string.count(x)
	if x == 'a' or x == 'u':
		a //= 2
	values.append(a)
print(min(values))


key = 'Bulbasaur'
s = input()
char_count = {}
for ch in key:
	char_count[ch] = 0
for ch in s:
	try:
		char_count[ch] += 1
	except KeyError:
		pass
char_count['u'] //= 2
char_count['a'] //= 2
min_count = 100001
for (key, value) in char_count.items():
	min_count = min(min_count, value)
print(min_count)


import re
import collections
a = input()
x = collections.defaultdict(int)
for i in a:
	x[i] += 1
erg = min(x['B'], x['u'] // 2, x['l'], x['b'], x['a'] // 2, x['s'], x['r'])
print(erg)


a = input()
b = len(a)
tab = [0 for x in range(7)]
for i in range(b):
	if a[i] == 'B':
		tab[0] += 1
	if a[i] == 'u':
		tab[1] += 1
	if a[i] == 'l':
		tab[2] += 1
	if a[i] == 'a':
		tab[3] += 1
	if a[i] == 's':
		tab[4] += 1
	if a[i] == 'r':
		tab[5] += 1
	if a[i] == 'b':
		tab[6] += 1
c = 10000000
for y in range(7):
	if tab[y] < c:
		c = tab[y]
while c >= 0:
	if c * 2 <= tab[1] and c * 2 <= tab[3]:
		print(c)
		break
	elif c - 1 > 0:
		c = c - 1
	else:
		print('0')
		break


B = 0
u = 0
l = 0
b = 0
a = 0
s = 0
a = 0
u = 0
r = 0
x = input()
B = x.count('B')
u = x.count('u') // 2
l = x.count('l')
b = x.count('b')
a = x.count('a') // 2
s = x.count('s')
r = x.count('r')
print(min(B, u, l, b, a, s, r))


a = list(input().split()[0])
mydic = {}
mydic['B'] = 0
mydic['u'] = 0
mydic['l'] = 0
mydic['b'] = 0
mydic['a'] = 0
mydic['s'] = 0
mydic['r'] = 0
for elem in a:
	if elem in mydic.keys():
		mydic[elem] += 1
mydic['a'] //= 2
mydic['u'] //= 2
print(min(mydic.values()))


s = input()
ld = {}
for e in s:
	if e in ld:
		ld[e] += 1
	else:
		ld[e] = 1
min_oc = -1
ls = ['B', 'u', 'l', 'b', 'a', 's', 'r']
for e in ls:
	if e in ld:
		v = ld[e]
		if e == 'a' or e == 'u':
			v = v // 2
		if min_oc == -1 or v < min_oc:
			min_oc = v
	else:
		print(0)
		quit()
print(min_oc)


z = 'Bulbasaur'
s = input()
sl = [0] * 500
for i in s:
	sl[ord(i)] += 1
ans = 0
f = 0
while 1:
	for i in z:
		if sl[ord(i)]:
			sl[ord(i)] -= 1
		else:
			f = 1
			break
	if f:
		break
	ans += 1
print(ans)


from collections import Counter
(c, pattern) = (Counter(input()), 'Bulbasaur')
print(min((c[ch] // pattern.count(ch) for ch in set(pattern))))


s = input()
x = 'Blbsr'
y = 'ua'
t1 = [0] * 5
t2 = [0] * 2
for l in s:
	if l == 'B':
		t1[0] += 1
	elif l == 'l':
		t1[1] += 1
	elif l == 'b':
		t1[2] += 1
	elif l == 's':
		t1[3] += 1
	elif l == 'r':
		t1[4] += 1
	elif l == 'u':
		t2[0] += 1
	elif l == 'a':
		t2[1] += 1
print(min(min(t1), min(t2) // 2))


s = input()
t = [0, 0, 0, 0, 0, 0, 0]
for i in s:
	if i == 'B':
		t[0] += 1
	elif i == 'a':
		t[1] += 1
	elif i == 'b':
		t[2] += 1
	elif i == 'l':
		t[3] += 1
	elif i == 'r':
		t[4] += 1
	elif i == 's':
		t[5] += 1
	elif i == 'u':
		t[6] += 1
t[1] = t[1] // 2
t[6] = t[6] // 2
print(min(t))


Bb = input()
x = 'Bulbasaur'
ls = ['B', 'b', 'u', 'l', 'a', 'r', 's']
m = []
for c in ls:
	y = Bb.count(c) // x.count(c)
	m.append(y)
k = min(m)
print(k)


def main():
	from collections import Counter
	try:
		while True:
			c = Counter(input())
			print(min(c['B'], c['u'] >> 1, c['l'], c['b'], c['a'] >> 1, c['s'], c['r']))
	except EOFError:
		pass
main()


def prog():
	n = input()
	a = 'Bulbasaur'
	B = n.count('B')
	u = n.count('u') // 2
	l = n.count('l')
	b = n.count('b')
	a = n.count('a') // 2
	s = n.count('s')
	r = n.count('r')
	mas = [B, u, l, b, a, s, a, u, r]
	print(min(mas))
prog()


from collections import deque
from collections import Counter

def main():
	from sys import stdin
	lines = deque((line.strip() for line in stdin.readlines()))
	counts = Counter(lines[0])
	bulbasaur = Counter('Bulbasaur')
	minCount = len(lines[0])
	for (letter, count) in list(bulbasaur.items()):
		minCount = min(minCount, counts[letter] // count)
	print(minCount)

def __starting_point():
	main()
__starting_point()


gaz = input()
bukvy = [0, 0, 0, 0, 0, 0, 0]
for s in gaz:
	if s == 'a':
		bukvy[0] += 1
	elif s == 'B':
		bukvy[1] += 1
	elif s == 'b':
		bukvy[2] += 1
	elif s == 'l':
		bukvy[3] += 1
	elif s == 'r':
		bukvy[4] += 1
	elif s == 's':
		bukvy[5] += 1
	elif s == 'u':
		bukvy[6] += 1
bukvy[0] = bukvy[0] // 2
bukvy[6] = bukvy[6] // 2
minb = min(bukvy)
print(minb)


s = input()
cur_min1 = 10 ** 6
cur_min2 = 10 ** 6
d = ['B', 'u', 'l', 'b', 'a', 's', 'r']
for element in d:
	if element == 'u' or element == 'a':
		if s.count(element) < cur_min2:
			cur_min2 = s.count(element)
	if s.count(element) < cur_min1:
		cur_min1 = s.count(element)
print(min(cur_min1, cur_min2 // 2))


s = input()
foo = 'Bulbasr'
ans = []
for i in foo:
	if i == 'u' or i == 'a':
		ans.append(s.count(i) // 2)
	else:
		ans.append(s.count(i))
print(min(ans))


s = input()
a = ['B', 'u', 'l', 'b', 'a', 's', 'r']
b = []
for i in range(len(a)):
	if a[i] != 'a' and a[i] != 'u':
		b.append(s.count(a[i]))
	else:
		b.append(int(s.count(a[i]) / 2))
print(min(b))


d1 = {}
for v in 'Bulbasaur':
	d1[v] = d1.get(v, 0) + 1
d2 = {}
for v in input():
	d2[v] = d2.get(v, 0) + 1
print(min([d2.get(i, 0) // d1[i] for i in d1.keys()]))


x = input()
lst = [0, 0, 0, 0, 0, 0, 0]
for y in range(0, len(x)):
	if x[y] == 'B':
		lst[0] += 1
	elif x[y] == 'u':
		lst[1] += 1
	elif x[y] == 'l':
		lst[2] += 1
	elif x[y] == 'b':
		lst[3] += 1
	elif x[y] == 'a':
		lst[4] += 1
	elif x[y] == 's':
		lst[5] += 1
	elif x[y] == 'r':
		lst[6] += 1
lst[1] = int(lst[1] / 2)
lst[4] = int(lst[4] / 2)
print(min(lst))


s = input()
ar = ['B', 'u', 'l', 'b', 'a', 's', 'r']
found = [0, 0, 0, 0, 0, 0, 0]
for i in range(len(s)):
	for j in range(len(ar)):
		if s[i] == ar[j]:
			found[j] += 1
			break
found[4] /= 2
found[1] /= 2
if len(found) == len(ar):
	print(int(min(found)))
else:
	print(0)


t = input()
A = [0] * 150
for i in [t[i] for i in range(len(t))]:
	A[ord(i)] += 1
B = [A[ord('B')], A[ord('u')] // 2, A[ord('l')], A[ord('b')], A[ord('a')] // 2, A[ord('s')], A[ord('r')]]
print(min(B))


q = input()
p = [0] * 250
for i in q:
	p[ord(i)] += 1
ans = p[ord('B')]
ans = min(ans, p[ord('u')] // 2)
ans = min(ans, p[ord('a')] // 2)
ans = min(ans, p[ord('s')])
ans = min(ans, p[ord('b')], p[ord('l')], p[ord('r')])
print(ans)


from collections import defaultdict
import time
from functools import partial

def normalizer(num, letter):
	count = 0

	def inner(new_letter):
		nonlocal count
		if new_letter is None:
			return count / num
		if new_letter != letter:
			raise AssertError('{} does not equal to {}'.format(new_letter, letter))
		count += 1
		return count / num
	return inner

def get_number_of_unique_chars(text):
	return len(set(text))

def count_keyword(text, keyword):
	keyword_dict = {t: normalizer(keyword.count(t), t) for t in keyword}
	for t in text:
		if t not in keyword:
			continue
		keyword_dict[t](t)
	if len(keyword_dict.keys()) == get_number_of_unique_chars(keyword):
		return int(min([func(None) for func in keyword_dict.values()]))
	return 0

def main():
	keyword = 'Bulbasaur'
	text = input()
	print(count_keyword(text, keyword))
main()


from collections import Counter
b = 'Bulbasaur'
s = input()
c = Counter(s)
f = True
n = -1
while f:
	n += 1
	for i in b:
		if not c[i]:
			f = False
			break
		c[i] -= 1
print(n)


S = list(input())
B = 0
u = 0
l = 0
b = 0
a = 0
s = 0
r = 0
for x in S:
	if x == 'B':
		B += 1
	if x == 'u':
		u += 1
	if x == 'l':
		l += 1
	if x == 'b':
		b += 1
	if x == 'a':
		a += 1
	if x == 's':
		s += 1
	if x == 'r':
		r += 1
u //= 2
a //= 2
print(min(B, u, l, b, a, s, r))


n = input()
dic = {i: 0 for i in 'Bulbasaur'}
for i in n:
	if i in 'Bulbasaur':
		dic[i] += 1
dic['u'] = dic['u'] // 2
dic['a'] = dic['a'] // 2
print(min(dic.values()))


s = 'Bulbasaur'
a = input()
b = dict()
for i in a:
	b[i] = b.get(i, 0) + 1
cnt = 0
while True:
	x = 10
	for i in s:
		d = b.get(i, 0)
		if d == 0:
			x = 0
		else:
			b[i] = d - 1
	if x == 0:
		break
	cnt += 1
print(cnt)


s = input()
(a, b, c, d, e, f, g) = (s.count('B'), s.count('b'), s.count('l'), s.count('r'), s.count('s'), s.count('u') // 2, s.count('a') // 2)
print(min(a, b, c, d, e, f, g))


import math
frontpage = input()
wordSet = set('Bulbasaur')
counterA = 0
counterU = 0
remCounter = {'B': 0, 'l': 0, 'b': 0, 's': 0, 'r': 0}
for let in frontpage:
	if let in wordSet:
		if let == 'a':
			counterA += 1
		elif let == 'u':
			counterU += 1
		else:
			remCounter[let] += 1
remMin = math.inf
for key in remCounter.keys():
	remMin = min(remMin, remCounter[key])
res = min(remMin, counterA // 2, counterU // 2)
print(res)


def get_Bulbasaur(string_ori):
	temp_string = string_ori
	pok = 'Bulbasaur'
	count = int(temp_string.count(pok[0]) / pok.count(pok[0]))
	if count == 0:
		return 0
	for x in range(1, len(pok)):
		if count > temp_string.count(pok[x]) / pok.count(pok[x]):
			count = int(temp_string.count(pok[x]) / pok.count(pok[x]))
	return count
string_input = input()
val = get_Bulbasaur(string_input)
val = str(val)
print(val)


news = input()
count = 0
B = news.count('B')
u = news.count('u')
l = news.count('l')
b = news.count('b')
a = news.count('a')
s = news.count('s')
r = news.count('r')
while B > 0 and u > 1 and (l > 0) and (b > 0) and (a > 1) and (s > 0) and (r > 0):
	count += 1
	B -= 1
	u -= 2
	l -= 1
	b -= 1
	a -= 2
	s -= 1
	r -= 1
print(count)


x = input()
a = x.count('B')
b = x.count('u')
b = b // 2
c = x.count('l')
d = x.count('b')
e = x.count('s')
g = x.count('a')
g = g // 2
i = x.count('r')
k = [a, b, c, d, e, g, i]
l = min(k)
print(min(k))


from collections import Counter
s = Counter(input())
w = Counter('Bulbasaur')
ans = 10 ** 5
for (x, y) in w.most_common():
	ans = min(ans, s[x] // y)
print(ans)


text = input()
word = 'Bulbasaur'
n = len(word)
r = text.count('B')
if text.count('u') // 2 < r:
	r = text.count('u') // 2
if text.count('a') // 2 < r:
	r = text.count('a') // 2
if text.count('l') < r:
	r = text.count('l')
if text.count('b') < r:
	r = text.count('b')
if text.count('s') < r:
	r = text.count('s')
if text.count('r') < r:
	r = text.count('r')
print(r)


def pokemon():
	bulbasaur_dic = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
	content = input()
	for i in content:
		if i in bulbasaur_dic.keys():
			bulbasaur_dic[i] += 1
	bulbasaur_dic['u'] //= 2
	bulbasaur_dic['a'] //= 2
	output = min(bulbasaur_dic.values())
	print(output)
pokemon()


x = input()
b = x.count('B')
u = x.count('u')
l = x.count('l')
bb = x.count('b')
a = x.count('a')
s = x.count('s')
r = x.count('r')
ans = 0
while b >= 1 and u >= 2 and (l >= 1) and (bb >= 1) and (a >= 2) and (s >= 1) and (u >= 1) and (r >= 1):
	b -= 1
	u -= 2
	l -= 1
	bb -= 1
	a -= 2
	s -= 1
	r -= 1
	ans += 1
print(ans)


s = input()
index = {}
for l in s:
	if l in index:
		index[l] += 1
	else:
		index[l] = 1
if 'a' in index:
	index['a'] //= 2
if 'u' in index:
	index['u'] //= 2
min = 1000000
for l in ['B', 'u', 'l', 'b', 'a', 's', 'r']:
	if l in index:
		new_min = index[l]
		if new_min < min:
			min = new_min
	else:
		min = 0
		break
print(min)


def function1(string):
	B = string.count('B')
	u = string.count('u') // 2
	l = string.count('l')
	b = string.count('b')
	a = string.count('a') // 2
	s = string.count('s')
	r = string.count('r')
	return min(B, u, l, b, a, s, r)

def main():
	string = input()
	print(function1(string))
main()


s = input()
tmp = 'Bulbasaur'
d = {i: 0 for i in tmp}
for i in s:
	if i in d:
		d[i] += 1
ans = 100000
for i in d:
	chk = d[i]
	if i == 'a' or i == 'u':
		chk //= 2
	ans = min(ans, chk)
print(ans)


s = list(input())
dict = {}
for ch in s:
	if dict.get(ch) is not None:
		dict[ch] += 1
	else:
		dict[ch] = 1
if dict.get('a') is not None:
	dict['a'] //= 2
if dict.get('u') is not None:
	dict['u'] //= 2
tmp = 'Bulbasr'
ans = s.__len__()
for ch in tmp:
	if dict.get(ch) is not None:
		ans = min(ans, dict[ch])
	else:
		ans = 0
print(ans)


s = input()
a = [0] * 255
for i in s:
	a[ord(i)] += 1
ans = 10 ** 5
for i in 'Blbsr':
	ans = min(ans, a[ord(i)])
for i in 'au':
	ans = min(ans, a[ord(i)] // 2)
print(ans)


s = input()
d_c = {}
for c in s:
	if c not in d_c:
		d_c[c] = 1
	else:
		d_c[c] += 1
if 'B' in d_c and 'u' in d_c and ('l' in d_c) and ('b' in d_c) and ('a' in d_c) and ('s' in d_c) and ('r' in d_c):
	print(min([d_c['B'], d_c['u'] // 2, d_c['l'], d_c['b'], d_c['a'] // 2, d_c['s'], d_c['r']]))
else:
	print(0)


def Main():
	S = input()
	B = S.count('B')
	u = S.count('u')
	l = S.count('l')
	b = S.count('b')
	a = S.count('a')
	s = S.count('s')
	r = S.count('r')
	mn = min(B, l, b, s, r)
	print(min(B, u // 2, l, b, a // 2, s, r))
Main()


n = input()
s = 0
B = n.count('B')
u = int(n.count('u') / 2)
l = n.count('l')
b = n.count('b')
a = int(n.count('a') / 2)
s = n.count('s')
r = n.count('r')
print(min(B, u, l, b, a, s, r))


s = input()
f = []
for i in range(256):
	f.append(0)
for c in s:
	f[ord(c)] += 1
ans = min(f[ord('B')], f[ord('b')], f[ord('u')] // 2, f[ord('a')] // 2, f[ord('l')], f[ord('s')], f[ord('r')])
print(ans)


def main(my_string):
	freq = [0, 0, 0, 0, 0, 0, 0]
	for c in my_string:
		if c == 'B':
			freq[0] = freq[0] + 1
		elif c == 'u':
			freq[1] = freq[1] + 1
		elif c == 'l':
			freq[2] = freq[2] + 1
		elif c == 'b':
			freq[3] = freq[3] + 1
		elif c == 'a':
			freq[4] = freq[4] + 1
		elif c == 's':
			freq[5] = freq[5] + 1
		elif c == 'r':
			freq[6] = freq[6] + 1
	if freq[1] > 0:
		freq[1] = freq[1] // 2
	if freq[4] > 0:
		freq[4] = freq[4] // 2
	return min(freq)
my_string = input()
print(main(my_string))


st = input()
B = st.count('B')
b = st.count('b')
u = st.count('u') // 2
l = st.count('l')
a = st.count('a') // 2
s = st.count('s')
r = st.count('r')
m = min(B, b, u, l, a, s, r)
print(m)


a = input()
s = 'Bulbasaur'
t = [0] * 7
for j in a:
	if j == 'B':
		t[0] += 1
	elif j == 'b':
		t[1] += 1
	elif j == 'a':
		t[2] += 0.5
	elif j == 'u':
		t[3] += 0.5
	elif j == 'r':
		t[4] += 1
	elif j == 'l':
		t[5] += 1
	elif j == 's':
		t[6] += 1
print(int(min(t)))


from collections import defaultdict
d = defaultdict(int)
for s in input():
	d[s] += 1
a = min([d['B'], d['l'], d['b'], d['r'], d['s']])
b = min([d['a'] // 2, d['u'] // 2])
print(min(a, b))


def codeforces(text):
	string = 'Bulbasaur'
	needed = {}
	for letter in string:
		if letter in needed:
			needed[letter] += 1
		else:
			needed[letter] = 1
	counts = []
	for char in set(string):
		counts.append(text.count(char) // needed[char])
	return min(counts)
text = input()
print(codeforces(text))


string = input()
Bulbasaur = [0] * 7
for i in string:
	if i == 'B':
		Bulbasaur[0] += 1
	elif i == 'u':
		Bulbasaur[1] += 1
	elif i == 'l':
		Bulbasaur[2] += 1
	elif i == 'b':
		Bulbasaur[3] += 1
	elif i == 'a':
		Bulbasaur[4] += 1
	elif i == 's':
		Bulbasaur[5] += 1
	elif i == 'r':
		Bulbasaur[6] += 1
ans = min(Bulbasaur[0], Bulbasaur[1] // 2, Bulbasaur[2], Bulbasaur[3], Bulbasaur[4] // 2, Bulbasaur[5], Bulbasaur[6])
print(ans)


def solve(s):
	T = {}
	for c in 'Bulbasaur':
		if c in T:
			T[c] += 1
		else:
			T[c] = 1
	S = len(s)
	for c in T:
		S = min(S, s.count(c) // T[c])
	return S
s = input().rstrip()
print(solve(s))


from sys import stdin, stdout
s = stdin.readline().strip()
cnt = min(s.count('B'), s.count('l'))
cnt = min(cnt, s.count('b'))
cnt = min(cnt, s.count('r'))
cnt = min(cnt, s.count('s'))
cnt = min(cnt, s.count('a') // 2)
cnt = min(cnt, s.count('u') // 2)
stdout.write(str(cnt))


import sys

def main():
	news = input()
	dic = make_dict(news)
	count = catch_bulb(dic)
	print(count)

def make_dict(news):
	dic = {}
	for s in news:
		if s in dic:
			dic[s] += 1
		else:
			dic[s] = 1
	return dic

def catch_bulb(dic):
	count = 0
	while ('B' in dic and dic['B'] >= 1) and ('u' in dic and dic['u'] > 1) and ('l' in dic and dic['l'] >= 1) and ('b' in dic and dic['b'] >= 1) and ('a' in dic and dic['a'] > 1) and ('s' in dic and dic['s'] >= 1) and ('r' in dic and dic['r'] >= 1):
		count += 1
		dic['B'] -= 1
		dic['u'] -= 2
		dic['l'] -= 1
		dic['b'] -= 1
		dic['a'] -= 2
		dic['s'] -= 1
		dic['r'] -= 1
	return count
main()


line = input()
bulba_dict = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
for i in line:
	if i in bulba_dict.keys():
		bulba_dict[i] += 1
bulba_dict['u'] = bulba_dict['u'] // 2
bulba_dict['a'] = bulba_dict['a'] // 2
print(min(bulba_dict.values()))


s = input()
b = list('Bulbasr')
a = [0] * 7
for i in range(len(s)):
	if s[i] in b:
		a[b.index(s[i])] += 1
a[1] //= 2
a[4] //= 2
l = min(a)
print(l)


import sys
from collections import *
a = defaultdict(int)
for s in sys.stdin.readlines():
	continue
for i in s:
	a[i] += 1
ans = 10 ** 5 + 1
for i in 'Blbsr':
	ans = min(ans, a[i])
for i in 'au':
	ans = min(ans, a[i] // 2)
print(ans)


a = input()
h = a.count('B')
k = int(a.count('u') / 2)
l = a.count('l')
m = a.count('b')
n = int(a.count('a') / 2)
p = a.count('s')
q = a.count('r')
print(min(h, k, l, m, n, p, q))


import math
from fractions import Fraction as frac

def solve(case_no):
	s = str(input())
	sl = len(s)
	freq = [0 for i in range(7)]
	for i in range(sl):
		if s[i] == 'B':
			freq[0] += 1
		elif s[i] == 'u':
			freq[1] += 1
		elif s[i] == 'l':
			freq[2] += 1
		elif s[i] == 'b':
			freq[3] += 1
		elif s[i] == 'a':
			freq[4] += 1
		elif s[i] == 's':
			freq[5] += 1
		elif s[i] == 'r':
			freq[6] += 1
	freq[1] //= 2
	freq[4] //= 2
	maxi = 10000000
	for i in range(7):
		maxi = min(maxi, freq[i])
	print(maxi)
t = 1
for i in range(1, t + 1):
	solve(i)


import math
text = input()
m = text.count('B')
m = min(m, math.floor(text.count('u') / 2))
m = min(m, text.count('l'))
m = min(m, text.count('b'))
m = min(m, math.floor(text.count('a') / 2))
m = min(m, text.count('s'))
m = min(m, text.count('r'))
print(m)


ans = 0
used = [0] * 256
a = [0] * 256
q = 'Bulbasaur'
for elem in q:
	a[ord(elem)] += 1
s = input()
for elem in s:
	used[ord(elem)] += 1
ans = 98148914891413
for i in range(256):
	if a[i] != 0:
		ans = min(ans, used[i] // a[i])
print(ans)


S = input()
B = 0
u = 0
l = 0
a = 0
b = 0
s = 0
r = 0
for i in range(len(S)):
	if S[i] == 'B':
		B += 1
	elif S[i] == 'u':
		u += 1
	elif S[i] == 'l':
		l += 1
	elif S[i] == 'b':
		b += 1
	elif S[i] == 'a':
		a += 1
	elif S[i] == 's':
		s += 1
	elif S[i] == 'r':
		r += 1
ans = 0
while True:
	B -= 1
	u -= 2
	l -= 1
	b -= 1
	a -= 2
	s -= 1
	r -= 1
	if min(B, u, l, a, b, s, r) >= 0:
		ans += 1
	else:
		print(ans)
		break


text = input()
bolba = 'Bulbasaur'
chars = {}
for i in bolba:
	chars[i] = 0
for i in text:
	if i in bolba:
		chars[i] += 1
chars['u'] = chars['u'] // 2
chars['a'] = chars['a'] // 2
print(min(chars.values()))


secret = 'Bulbasaur'
d = dict()
for c in secret:
	if c not in d:
		d[c] = 0
	d[c] += 1
s = input()
e = dict()
for c in s:
	if c not in e:
		e[c] = 0
	e[c] += 1
answ = 1791791791
for c in d.keys():
	if c not in e:
		answ = 0
	else:
		answ = min(answ, e[c] // d[c])
print(answ)


x = 'Bulbasaur'
n = input()
c = 0
for i in x:
	if i in n:
		c += 1
if c == 9:
	w = [n.count('B'), n.count('u') // 2, n.count('l'), n.count('b'), n.count('a') // 2, n.count('s'), n.count('r')]
	print(min(w))
else:
	print('0')


s = input()
res = 10 ** 5 + 1
cont = 0
a = [0] * 256
for i in s:
	if 'Blbsr'.find(i) != -1:
		a[ord(i)] += 1
	elif i == 'a' or i == 'u':
		a[ord(i)] += 0.5
for i in range(256):
	if a[i] != 0:
		cont += 1
		if a[i] < res:
			res = a[i]
if cont < 7:
	print(0)
else:
	print(int(res))


s1 = input()
if len(s1) < 9:
	print(0)
else:
	B = s1.count('B')
	a = s1.count('a')
	u = s1.count('u')
	l = s1.count('l')
	b = s1.count('b')
	s = s1.count('s')
	r = s1.count('r')
	print(min(B, u // 2, l, b, a // 2, s, r))


s = input()
check = ['B', 'u', 'l', 'b', 'a', 's', 'r']
occur = [0] * len(check)
ans = 0
for i in s:
	if i in check:
		occur[check.index(i)] += 1
occur[1] //= 2
occur[4] //= 2
print(min(occur))


(s, ss) = (input(), 'Blbsr')
print(min([s.count(i) for i in ss] + [s.count('u') // 2, s.count('a') // 2]))


x = input()
if 'l' and 's' and 'r' and ('B' in x) and (x.count('a') >= 2) and (x.count('u') >= 2):
	print(min(x.count('r'), x.count('l'), x.count('s'), x.count('B'), int(x.count('u') / 2), int(x.count('a') / 2), x.count('b')))
else:
	print(0)


s = input()
n = len(s)
t = 'Bulbasaur'
h = dict()
for i in range(n):
	if s[i] in h:
		h[s[i]] += 1
	else:
		h[s[i]] = 1
res = 1000000007
if 'B' in h:
	res = min(res, h['B'])
else:
	res = 0
if 'u' in h:
	res = min(res, h['u'] // 2)
else:
	res = 0
if 'l' in h:
	res = min(res, h['l'])
else:
	res = 0
if 'b' in h:
	res = min(res, h['b'])
else:
	res = 0
if 'a' in h:
	res = min(res, h['a'] // 2)
else:
	res = 0
if 's' in h:
	res = min(res, h['s'])
else:
	res = 0
if 'r' in h:
	res = min(res, h['r'])
else:
	res = 0
print(res)


s = input()
l = {'B': s.count('B'), 'u': s.count('u'), 'l': s.count('l'), 'b': s.count('b'), 'a': s.count('a'), 's': s.count('s'), 'r': s.count('r')}
for i in range(1, len(s)):
	if not (l['B'] >= i and l['u'] >= i * 2 and (l['l'] >= i) and (l['b'] >= i) and (l['a'] >= i * 2) and (l['s'] >= i) and (l['r'] >= i)):
		print(i - 1)
		break
else:
	print(0)


def main():
	text = str(input())
	wanted = 'Bulbasaur'
	c = text.count(wanted[0])
	for w in wanted:
		c = min(c, text.count(w) // wanted.count(w))
	print(c)
main()


import sys
digitInput = list(sys.stdin.readline().strip('\n'))
word = 'Bulbbasaur'
wordList = [0 for i in range(len(word))]
for w in range(len(word)):
	if word[w] == 'u' or word[w] == 'a':
		wordList[w] += digitInput.count(word[w]) // 2
	else:
		wordList[w] += digitInput.count(word[w])
sys.stdout.write(str(min(wordList)))


s = input()
amount = dict()
r = ['B', 'u', 'l', 'b', 'a', 's', 'r']
for w in r:
	amount[w] = 0
for i in range(len(s)):
	if s[i] in ['B', 'u', 'l', 'b', 'a', 's', 'r']:
		amount[s[i]] += 1
ans = 10 ** 6
for w in r:
	if w in ('u', 'a'):
		ans = min(ans, amount[w] // 2)
	else:
		ans = min(ans, amount[w])
print(ans)


from collections import Counter
z = Counter(input())
s = 'Blbsr'
s2 = 'au'
minVal = 2147483647
for it in s:
	if z[it] < minVal:
		minVal = z[it]
for it in s2:
	if z[it] // 2 < minVal:
		minVal = z[it] // 2
print(minVal)


q = 'Balbsur'
d = dict([[x, 0] for x in q])
s = input().strip()
for x in s:
	if x in q:
		d[x] += 1
m = min(d['u'], d['a']) // 2
for x in d:
	m = min(m, d[x])
print(m)


s = input()
pattern = 'Bulbasaur'
cnt_of_each_letter = []
for letter in pattern:
	cnt = s.count(letter)
	if letter == 'u' or letter == 'a':
		cnt //= 2
	cnt_of_each_letter.append(cnt)
print(min(cnt_of_each_letter))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	c = collections.Counter(S())
	t = 'Bulbasaur'
	r = 0
	while 1:
		for k in t:
			if c[k] < 1:
				return r
			c[k] -= 1
		r += 1
	return -1
print(main())


test = input()
check1 = False
countB = 0
countu = 0
countl = 0
countb = 0
counta = 0
counts = 0
countr = 0
for p in range(0, len(test)):
	if test[p] == 'B':
		countB += 1
	if test[p] == 'u':
		countu += 1
	if test[p] == 'l':
		countl += 1
	if test[p] == 'b':
		countb += 1
	if test[p] == 'a':
		counta += 1
	if test[p] == 's':
		counts += 1
	if test[p] == 'r':
		countr += 1
countu = countu / 2
counta = counta / 2
cm = min(countB, countu, countb, counta, countr, countl, counts)
print(int(cm))


s = input()
j = []
d = {'B': 0, 'b': 0, 'u': 0, 'a': 0, 'l': 0, 's': 0, 'r': 0}
for i in range(len(s)):
	if s[i] in d:
		d[s[i]] += 1
for i in d:
	if i == 'a' or i == 'u':
		j.append(d[i] // 2)
	else:
		j.append(d[i])
print(min(j))


from collections import Counter, defaultdict
from math import factorial
s = input()
c = Counter(s)
ans = min(c['B'], c['u'] // 2, c['b'], c['l'], c['a'] // 2, c['s'], c['r'])
print(ans)


lst = {}
for i in 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':
	lst[i] = 0
n = input()
for i in n:
	lst[i] += 1
ans = 100000
for i in 'Bulbasr':
	if i == 'a' or i == 'u':
		tmp = lst[i] // 2
	else:
		tmp = lst[i]
	ans = min(ans, tmp)
print(ans)


import re
entrada = input()
match = re.compile('(\\w)')
letras = match.findall(entrada)
bulbassauro = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
monta = []
passou = 0
total = 0
for (i, xablau) in bulbassauro.items():
	matches = list(filter(lambda x: x == i, letras))
	bulbassauro[i] = len(matches)
bulbassauro['u'] = bulbassauro['u'] // 2
bulbassauro['a'] = bulbassauro['a'] // 2
print(min(bulbassauro.values()))


s = input()
c = [s.count(x) for x in 'Bulbasur']
c[1] //= 2
c[4] //= 2
print(min(c))


from collections import Counter
counter = Counter(input())
Bulbasaur = Counter('Bulbasaur')
ans = 0
while counter & Bulbasaur == Bulbasaur:
	counter.subtract(Bulbasaur)
	ans += 1
print(ans)


y = input()
t = 'Bulbasr'
B = y.count('B')
u = y.count('u')
l = y.count('l')
b = y.count('b')
a = y.count('a')
s = y.count('s')
r = y.count('r')
ans = min(B, u // 2, a // 2, l, b, s, r)
print(ans)


S = [0] * 7
N = input()
for n in N:
	if n == 'B':
		S[0] += 1
	elif n == 'b':
		S[1] += 1
	elif n == 'u':
		S[2] += 1
	elif n == 'l':
		S[3] += 1
	elif n == 's':
		S[4] += 1
	elif n == 'a':
		S[5] += 1
	elif n == 'r':
		S[6] += 1
S[5] //= 2
S[2] //= 2
print(min(S))


from collections import defaultdict
word_ratio = defaultdict(int)
for word in 'Bulbasaur':
	word_ratio[word] += 1
news = input()
news_ratio = defaultdict(int)
for i in news:
	if i in word_ratio:
		news_ratio[i] += 1
print(min([news_ratio[i] // word_ratio[i] for i in word_ratio]))


from sys import stdin
s = stdin.readline()[:-1]
val_dict = {}
t = 'Bulbasaur'
for i in s:
	if i in t:
		if i in val_dict:
			val_dict[i] += 1
		else:
			val_dict[i] = 1
not_found = True
ans = 0
while not_found:
	for i in t:
		if i in val_dict:
			val_dict[i] -= 1
			if val_dict[i] == 0:
				del val_dict[i]
		else:
			not_found = False
			break
	if not not_found:
		break
	ans += 1
print(ans)


line = input()
name = 'Bulbasaur'
letters = {letter: 0 for letter in name}
for letter in line:
	if letter in letters:
		letters[letter] += 1
double_letters = 'au'
for letter in double_letters:
	letters[letter] //= 2
answer = min(letters.values())
print(answer)


import sys
text = input().strip()
B = text.count('B')
b = text.count('b')
u = text.count('u')
l = text.count('l')
a = text.count('a')
s = text.count('s')
r = text.count('r')
while u < 2 * B:
	B -= 1
while a < 2 * B:
	B -= 1
lst = [b, l, s, r]
x = min(lst)
if x <= B:
	print(x)
else:
	print(B)


st = input()
wd = []
wd.append(st.count('B'))
wd.append(st.count('u') // 2)
wd.append(st.count('l'))
wd.append(st.count('b'))
wd.append(st.count('a') // 2)
wd.append(st.count('s'))
wd.append(st.count('r'))
print(min(wd))


n = list(map(str, input()))
B = n.count('B')
u = n.count('u') // 2
l = n.count('l')
b = n.count('b')
a = n.count('a') // 2
s = n.count('s')
r = n.count('r')
g = [B, u, l, b, a, s, r]
if B == 0 or u == 0 or l == 0 or (b == 0) or (a == 0) or (s == 0) or (r == 0):
	print(0)
else:
	print(min(g))


class Counter(dict):

	def __missing__(self, key):
		return 0
newspaper = input()
c = Counter()
for letter in newspaper:
	c[letter] += 1
ans = []
for ones in ['B', 'l', 'b', 's', 'r']:
	ans.append(c[ones])
for twos in ['u', 'a']:
	ans.append(c[twos] // 2)
print(min(ans))


const = list('Bulbasaur')
alph_const = set(const)
cnt = {i: const.count(i) for i in alph_const}
text = list(str(input()))
alph_text = set(text)
cnt_text = {i: text.count(i) for i in alph_text}
tmp = set()
for i in cnt_text.keys():
	if i not in cnt.keys():
		tmp.add(i)
for i in tmp:
	cnt_text.pop(i)
out = 0
while True:
	if len(cnt_text) < len(cnt):
		break
	for i in cnt_text:
		cnt_text[i] = cnt_text[i] - cnt[i]
	if min(cnt_text.values()) >= 0:
		out += 1
	else:
		break
print(out)


s = input()
counts = [0 for i in range(0, 256)]
for c in s:
	counts[ord(c)] += 1
counts[ord('u')] //= 2
counts[ord('a')] //= 2
wants = [counts[ord('B')], counts[ord('u')], counts[ord('l')], counts[ord('b')], counts[ord('a')], counts[ord('s')], counts[ord('r')]]
ans = min(wants)
print(ans)


n = input()
f = 'Bulbasaur'
lst = []
for i in f:
	if i != 'a' and i != 'u':
		lst.append(n.count(i))
	elif i == 'a':
		lst.append(n.count('a') // 2)
	else:
		lst.append(n.count('u') // 2)
print(min(lst))


import collections

def countIt(inp):
	target_counts = collections.Counter('Bulbasaur')
	chars = set()
	for i in 'Bulbasaur':
		chars.add(i)
	counts = []
	for i in collections.Counter('Bulbasur'):
		counts.append(inp.count(i) // target_counts[i])
	print(min(counts))
countIt(input())


pokemon = ['B', 'u', 'l', 'b', 'a', 's', 'r']
S = input()
counter = [0, 0, 0, 0, 0, 0, 0]
for i in range(0, len(S)):
	for j in range(0, 7):
		if S[i] == pokemon[j]:
			counter[j] += 1
counter[1] //= 2
counter[4] //= 2
counter.sort()
print(counter[0])


from collections import Counter
s = input().strip()
c = Counter(s)
word = Counter('Bulbasaur')
ans = min((c[i] // word[i] for i in word))
print(ans)


from math import floor
newspaper = input()
bulbasaur = dict()
for i in newspaper:
	if not i in bulbasaur:
		bulbasaur[i] = 1
	else:
		bulbasaur[i] += 1
for l in 'Bulbasr':
	if not l in bulbasaur:
		print(0)
		quit()
letters = list()
for l in 'Bulbasr':
	if l == 'u' or l == 'a':
		letters.append(int(floor(bulbasaur[l] / 2)))
	else:
		letters.append(bulbasaur[l])
print(min(letters))


char = set('Bulbasaur')
d = dict()
for i in char:
	d[i] = 0
s = input()
for i in s:
	if i in char:
		d[i] += 1
for i in d:
	if i in ('a', 'u'):
		d[i] //= 2
print(min((d[i] for i in d)))


from collections import Counter
import sys

def substraction_charset(charset1, charset2):
	charset1.subtract(charset2)
	for char in charset1:
		if charset1[char] < 0:
			return False
	return True

def compile_words(word, data):
	chars_word = Counter(word)
	chars_data = Counter(data)
	count = 0
	while substraction_charset(chars_data, chars_word):
		count += 1
	return count
print(compile_words('Bulbasaur', sys.stdin.read()))


stroka = str(input())
b = 'Bulbasaur'
frequencys = {}
for i in stroka:
	if i in b:
		if i not in frequencys:
			frequencys[i] = 1
		else:
			frequencys[i] += 1
if len(frequencys) == 7:
	ret = frequencys['B']
	for (k, v) in frequencys.items():
		if k in ['u', 'a'] and int(v / 2) < ret:
			ret = int(v / 2)
		elif v < ret:
			ret = v
	print(ret)
else:
	print(0)


def main():
	from collections import Counter
	(b, c) = (Counter('Bulbasaur'), Counter(input()))
	for (k, v) in b.items():
		b[k] = c[k] // v
	print(min(b.values()))
main()


import math
a = input()
b = 'Bulbasaur'
l = len(a)
w = math.inf
k = 7 * [0]
for i in range(0, l, 1):
	if a[i] == 'B':
		k[0] += 1
	elif a[i] == 'u':
		k[1] += 1
	elif a[i] == 'l':
		k[2] += 1
	elif a[i] == 'b':
		k[3] += 1
	elif a[i] == 'a':
		k[4] += 1
	elif a[i] == 's':
		k[5] += 1
	elif a[i] == 'r':
		k[6] += 1
k[4] //= 2
k[1] //= 2
for i in range(0, 7, 1):
	if k[i] < w:
		w = k[i]
print(w)


s = input()
l = 'Bulbasaur'
l1 = []
for i in l:
	if i == 'u':
		l1.append(s.count('u') // 2)
	elif i == 'a':
		l1.append(s.count('a') // 2)
	else:
		l1.append(s.count(i))
if 0 in l1:
	print(0)
else:
	print(min(l1))


characters = {'B': 0, 'u': 0, 'l': 0, 'b': 0, 'a': 0, 's': 0, 'r': 0}
s = list(input())
for c in s:
	if characters.get(c) != None:
		characters[c] += 1
characters['a'] = int(characters['a'] / 2)
characters['u'] = int(characters['u'] / 2)
print(min(characters.values()))


str = input()
cnt = {}
for char in str:
	if char in cnt:
		cnt[char] += 1
	else:
		cnt[char] = 1
cnts = []
if 'B' in cnt:
	cnts.append(cnt['B'])
else:
	cnts.append(0)
if 'u' in cnt:
	cnts.append(cnt['u'] / 2)
else:
	cnts.append(0)
if 'l' in cnt:
	cnts.append(cnt['l'])
else:
	cnts.append(0)
if 'b' in cnt:
	cnts.append(cnt['b'])
else:
	cnts.append(0)
if 'a' in cnt:
	cnts.append(cnt['a'] / 2)
else:
	cnts.append(0)
if 's' in cnt:
	cnts.append(cnt['s'])
else:
	cnts.append(0)
if 'r' in cnt:
	cnts.append(cnt['r'])
else:
	cnts.append(0)
if cnts:
	cnts.sort()
	print(int(cnts[0]))
else:
	print('0')