#include <bits/stdc++.h>
using namespace std;
int lower_case[26] = {0}, upper_case[26] = {0};
char buf[100010];
int main() {
  scanf("%s", buf);
  int len = strlen(buf);
  for (int i = 0; i < len; i++) {
    if (buf[i] <= 'Z')
      upper_case[buf[i] - 'A']++;
    else
      lower_case[buf[i] - 'a']++;
  }
  int best = 100010;
  best = min(best, lower_case['a' - 'a'] / 2);
  best = min(best, upper_case['b' - 'a']);
  best = min(best, lower_case['b' - 'a']);
  best = min(best, lower_case['u' - 'a'] / 2);
  best = min(best, lower_case['l' - 'a']);
  best = min(best, lower_case['s' - 'a']);
  best = min(best, lower_case['r' - 'a']);
  printf("%d\n", best);
}
