#include <bits/stdc++.h>
using namespace std;
int arr[10];
int min(int*);
int main() {
  int i, j, a = 0, u = 0, t, q, res;
  string str;
  cin >> str;
  for (i = 0; i < str.size(); i++) {
    if (str[i] == 'B')
      arr[0]++;
    else if (str[i] == 'b')
      arr[1]++;
    else if (str[i] == 'l')
      arr[2]++;
    else if (str[i] == 'r')
      arr[3]++;
    else if (str[i] == 's')
      arr[4]++;
    else if (str[i] == 'a')
      a++;
    else if (str[i] == 'u')
      u++;
  }
  t = min(arr);
  q = (a < u) ? a : u;
  res = min(t, q / 2);
  cout << res << '\n';
  return 0;
}
int min(int a[]) {
  int i, s = a[0];
  for (i = 1; i < 5; i++) {
    if (a[i] < s) s = a[i];
  }
  return s;
}
