#include <bits/stdc++.h>
using namespace std;
string s;
int cnt[9];
int mins = 1e6;
const string t = "Bulbasr";
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++)
    for (int j = 0; j < t.size(); j++) {
      if (s[i] == t[j]) {
        cnt[j]++;
        break;
      }
    }
  cnt[1] /= 2;
  cnt[4] /= 2;
  for (int i = 0; i < t.size(); i++) mins = min(mins, cnt[i]);
  cout << mins << endl;
  return 0;
}
