#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[100000];
  gets(s);
  int i, j, k = 0, x, y = 0, m = 0, n = 0, B1 = 0, u = 0, l = 0, b = 0, a = 0,
            s1 = 0, r = 0;
  x = strlen(s);
  for (i = 0; i < x; i++) {
    if (s[i] == 'B') {
      B1++;
    }
    if (s[i] == 'u') {
      u++;
    }
    if (s[i] == 'l') {
      l++;
    }
    if (s[i] == 'b') {
      b++;
    }
    if (s[i] == 'a') {
      a++;
    }
    if (s[i] == 's') {
      s1++;
    }
    if (s[i] == 'r') {
      r++;
    }
  }
  for (B1; B1 > 0; B1--) {
    if (u >= 2 && l >= 1 && b >= 1 && a >= 2 && s1 >= 1 && r >= 1) {
      k++;
      u = u - 2;
      l = l - 1;
      b = b - 1;
      a = a - 2;
      s1 = s1 - 1;
      r = r - 1;
    }
  }
  cout << k << endl;
  return 0;
}
