#include <bits/stdc++.h>
using namespace std;
string bulba = "Bulbasaur";
int main() {
  ios_base::sync_with_stdio(0);
  map<char, int> mapa;
  string pat;
  cin >> pat;
  for (int j = 0; j < bulba.size(); ++j) mapa[bulba[j]] = 0;
  for (int i = 0; i < pat.size(); ++i) {
    bool flag = 0;
    for (int j = 0; j < bulba.size(); ++j)
      if (pat[i] == bulba[j]) flag = 1;
    if (flag) {
      ++mapa[pat[i]];
    }
  }
  int rpta = 10000000;
  for (auto it = mapa.begin(); it != mapa.end(); ++it) {
    if (it->first == 'a' or it->first == 'u')
      rpta = min(rpta, it->second / 2);
    else
      rpta = min(rpta, it->second);
  }
  cout << rpta << "\n";
  return 0;
}
