#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  map<char, int> cnt;
  getline(cin, str);
  cnt['B'] = 0;
  cnt['a'] = 0;
  cnt['b'] = 0;
  cnt['l'] = 0;
  cnt['r'] = 0;
  cnt['s'] = 0;
  cnt['u'] = 0;
  for (int i = 0; i < str.size(); i++) {
    cnt[str[i]]++;
  }
  cout << min(
      cnt['B'],
      min((cnt['a'] / 2),
          min(cnt['b'],
              min(cnt['l'], min(cnt['r'], min(cnt['s'], (cnt['u'] / 2)))))));
  return 0;
}
