#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  int B = 0;
  int u = 0;
  int A = 0;
  int l = 0;
  int b = 0;
  int s = 0;
  int r = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == 'B') B++;
    if (a[i] == 'u') u++;
    if (a[i] == 'a') A++;
    if (a[i] == 'l') l++;
    if (a[i] == 'b') b++;
    if (a[i] == 's') s++;
    if (a[i] == 'r') r++;
  }
  u = u / 2;
  A = A / 2;
  int i = 1;
  if (B == 0 || u == 0 || A == 0 || l == 0 || b == 0 || s == 0 || r == 0)
    cout << 0;
  else {
    while (B / i > 0 && u / i > 0 && A / i > 0 && l / i > 0 && b / i > 0 &&
           s / i > 0 && r / i > 0)
      i++;
    cout << i - 1;
  }
  return 0;
}
