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