#include <bits/stdc++.h>
using namespace std;
int hasBulbasaur(int a[150]) {
  if (a['B'] >= 1 && a['u'] >= 2 && a['l'] >= 1 && a['b'] >= 1 && a['a'] >= 2 &&
      a['s'] >= 1 && a['r'] >= 1)
    return 1;
  return 0;
}
void updateBulbasaur(int a[150]) {
  a['B'] -= 1;
  a['u'] -= 2;
  a['l'] -= 1;
  a['b'] -= 1;
  a['a'] -= 2;
  a['s'] -= 1;
  a['r'] -= 1;
}
void countBulbasaur(string s) {
  int i;
  int a[150] = {0};
  for (i = 0; i < s.length(); i++) {
    a[s[i]]++;
  }
  int count = 0;
  while (hasBulbasaur(a)) {
    count++;
    updateBulbasaur(a);
  }
  cout << count << "\n";
}
int main() {
  string s;
  cin >> s;
  countBulbasaur(s);
}
