# import random
# #dzien=int(input("Podaj numer dnia tygodnia "))
# # if dzien >= 1 and dzien <= 5:
# #     print("niema wolne")
# # else:
# #    print("jest wolne")

# # dzien=int(input("Podaj numer dnia tygodnia "))
# # if dzien == 6 and dzien == 7:
# #     print("jest wolne")
# # elif dzien >= 8:
# #     print("nie ma takiego dnia tygodnia")
# # else:
# #     print("nie jest wolne")

# # dzien=int(input("Podaj numer dnia tygodnia "))
# # if dzien == 1:
# #     print("PONIEDZIAŁEK")
# # elif dzien == 2:
# #     print("WTOREK")
# # elif dzien == 3:
# #     print("ŚRODA")
# # elif dzien == 4:
# #     print("CZWARTEK")
# # elif dzien == 5:
# #     print("PIĄTEK")
# # elif dzien == 6:
# #     print("SOBOTA")
# # else:
# #     print("NIEDZIELA")
# ile = int(input("Podaj ile razy losować"))
# losowe = []
# ile_zer = 0
# for i in range(ile):
#     liczba = random.randint(0,10)
#     if liczba != 5:
#         losowe.append(liczba)
#     if liczba == 0:
#         ile_zer += 1
        

# print(len(losowe))
# print(losowe)
# print(ile_zer)
# losowe.count("Piątki w wylosowanych liczbach" and 5)
# # if 7 in losowe
tekst = input("wprowadź słowo ")
ile = 0
for literka in tekst:
    if literka == "b":
        ile += 1
print(ile)