#include <bits/stdc++.h>
int cmp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }
int main() {
  char str[100005];
  int i, j, k;
  scanf("%s", str);
  int l = strlen(str);
  int cB = 0, cb = 0, cu = 0, ca = 0, cs = 0, cr = 0, cl = 0;
  for (i = 0; i < l; i++) {
    if (str[i] == 'B') {
      cB++;
    } else if (str[i] == 'b') {
      cb++;
    } else if (str[i] == 'u') {
      cu++;
    } else if (str[i] == 'a') {
      ca++;
    } else if (str[i] == 's') {
      cs++;
    } else if (str[i] == 'l') {
      cl++;
    } else if (str[i] == 'r') {
      cr++;
    } else {
      continue;
    }
  }
  int arry[5];
  arry[0] = cB;
  arry[1] = cs;
  arry[2] = cr;
  arry[3] = cl;
  arry[4] = cb;
  qsort(arry, 5, sizeof(int), cmp);
  int m1 = arry[0];
  int m2;
  if (cu <= ca) {
    m2 = cu;
  } else {
    m2 = ca;
  }
  int ans;
  if (m2 >= 2 * m1) {
    ans = m1;
  } else if (m2 < 2 * m1) {
    ans = m2 / 2;
  }
  printf("%d\n", ans);
  return (0);
}
