#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
char s[N];
int B = 0, ch[26], ans;
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  ans = n;
  for (int i = 1; i <= n; i++) {
    if (s[i] >= 'a' && s[i] <= 'z')
      ch[s[i] - 'a']++;
    else if (s[i] == 'B')
      B++;
  }
  ans = min(ans, B);
  ans = min(ans, ch[0] / 2);
  ans = min(ans, ch['u' - 'a'] / 2);
  ans = min(ans, ch['l' - 'a']);
  ans = min(ans, ch['r' - 'a']);
  ans = min(ans, ch['s' - 'a']);
  ans = min(ans, ch['b' - 'a']);
  printf("%d\n", ans);
}
