#include <bits/stdc++.h>
using namespace std;
char arr[100005];
char needc[7] = {'B', 'u', 'l', 'b', 'a', 's', 'r'};
int amount[7] = {0, 0, 0, 0, 0, 0, 0};
int need[7] = {1, 2, 1, 1, 2, 1, 1};
int main() {
  scanf("%s", arr);
  int l = strlen(arr);
  for (int i = 0; i < l; ++i) {
    for (int j = 0; j < 7; ++j) {
      if (needc[j] == arr[i]) {
        amount[j]++;
      }
    }
  }
  int mxx = 1000000;
  for (int j = 0; j < 7; ++j) {
    amount[j] /= need[j];
    mxx = min(mxx, amount[j]);
  }
  cout << mxx << "\n";
  return 0;
}
